@@ -26,6 +26,17 @@ const { execute, isLoading, result, error, status } = useTestRunner(props.id, {
2626 },
2727})
2828
29+ const accentColor = computed (() => {
30+ const map: Record <string , string > = {
31+ error: ' var(--color-red-500)' ,
32+ warning: ' var(--color-amber-500)' ,
33+ success: ' var(--color-emerald-500)' ,
34+ primary: ' var(--ui-primary)' ,
35+ neutral: ' var(--color-zinc-600)' ,
36+ }
37+ return map [props .color || ' ' ] || ' var(--ui-primary)'
38+ })
39+
2940async function handleClick() {
3041 try {
3142 if (props .onClick ) {
@@ -40,43 +51,40 @@ async function handleClick() {
4051 </script >
4152
4253<template >
43- <div class =" h-full p-5 rounded-lg bg-elevated border border-primary/5 hover:border-primary/10 transition-colors flex flex-col" >
44- <div class =" flex items-start justify-between gap-3 mb-3" >
45- <h3 class =" text-sm font-semibold text-highlighted leading-tight" >
46- {{ label }}
47- </h3 >
54+ <div
55+ class =" h-full bg-elevated border border-[var(--ui-border)] border-l-2 flex flex-col"
56+ :style =" { borderLeftColor: accentColor }"
57+ >
58+ <div
59+ class =" p-4 flex-1 flex flex-col cursor-pointer transition-colors hover:bg-white/[0.02] active:bg-white/[0.04] relative"
60+ @click =" handleClick"
61+ >
62+ <UIcon
63+ v-if =" isLoading"
64+ name =" i-lucide-loader-circle"
65+ class =" size-3.5 animate-spin text-primary absolute top-4 right-4"
66+ />
67+
4868 <UBadge
4969 v-if =" badge"
50- : color =" badge.color as any "
70+ color =" neutral "
5171 variant =" subtle"
52- class =" shrink-0 "
72+ class =" mb-2.5 w-fit "
5373 >
5474 {{ badge.label }}
5575 </UBadge >
56- </div >
57-
58- <p v-if =" description" class =" text-sm text-muted leading-relaxed mb-4 grow" >
59- {{ description }}
60- </p >
6176
62- <div class =" mt-auto" >
63- <UButton
64- block
65- :color =" color as any"
66- :loading =" isLoading"
67- @click =" handleClick"
68- >
77+ <h3 class =" text-sm font-medium text-highlighted leading-snug" >
6978 {{ label }}
70- </UButton >
79+ </h3 >
80+
81+ <p v-if =" description" class =" text-xs text-muted leading-relaxed mt-1.5 line-clamp-2" :title =" description" >
82+ {{ description }}
83+ </p >
7184 </div >
7285
73- <PlaygroundTestResult
74- v-if =" showResult"
75- :status
76- :response =" result"
77- :error
78- compact
79- class =" mt-4"
80- />
86+ <div v-if =" showResult" class =" px-4 pb-4" @click.stop >
87+ <PlaygroundTestResult :status :response =" result" :error compact />
88+ </div >
8189 </div >
8290</template >
0 commit comments