Skip to content

Commit 2ee4ac4

Browse files
committed
refactor: simplify template props usage
1 parent 5e72e34 commit 2ee4ac4

39 files changed

+82
-82
lines changed

packages/elements/src/artifact/ArtifactAction.vue

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const classes = computed(() => cn(
2727
</script>
2828

2929
<template>
30-
<TooltipProvider v-if="props.tooltip">
30+
<TooltipProvider v-if="tooltip">
3131
<Tooltip>
3232
<TooltipTrigger as-child>
3333
<Button
@@ -38,16 +38,16 @@ const classes = computed(() => cn(
3838
}"
3939
>
4040
<component
41-
:is="props.icon"
42-
v-if="props.icon"
41+
:is="icon"
42+
v-if="icon"
4343
class="size-4"
4444
/>
4545
<slot v-else />
46-
<span class="sr-only">{{ props.label || props.tooltip }}</span>
46+
<span class="sr-only">{{ label || tooltip }}</span>
4747
</Button>
4848
</TooltipTrigger>
4949
<TooltipContent>
50-
<p>{{ props.tooltip }}</p>
50+
<p>{{ tooltip }}</p>
5151
</TooltipContent>
5252
</Tooltip>
5353
</TooltipProvider>
@@ -61,11 +61,11 @@ const classes = computed(() => cn(
6161
}"
6262
>
6363
<component
64-
:is="props.icon"
65-
v-if="props.icon"
64+
:is="icon"
65+
v-if="icon"
6666
class="size-4"
6767
/>
6868
<slot v-else />
69-
<span class="sr-only">{{ props.label || props.tooltip }}</span>
69+
<span class="sr-only">{{ label || tooltip }}</span>
7070
</Button>
7171
</template>

packages/elements/src/chain-of-thought/ChainOfThoughtImage.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const props = defineProps<{
1919
<slot />
2020
</div>
2121
<p v-if="caption" class="text-muted-foreground text-xs">
22-
{{ props.caption }}
22+
{{ caption }}
2323
</p>
2424
</div>
2525
</template>

packages/elements/src/chain-of-thought/ChainOfThoughtStep.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const statusStyles = {
2727
:class="
2828
cn(
2929
'flex gap-2 text-sm',
30-
statusStyles[props.status],
30+
statusStyles[status],
3131
'fade-in-0 slide-in-from-top-2 animate-in',
3232
props.class as string,
3333
)
@@ -41,12 +41,12 @@ const statusStyles = {
4141
/>
4242
</div>
4343
<div class="flex-1 space-y-2">
44-
<div>{{ props.label }}</div>
44+
<div>{{ label }}</div>
4545
<div
46-
v-if="props.description"
46+
v-if="description"
4747
class="text-muted-foreground text-xs"
4848
>
49-
{{ props.description }}
49+
{{ description }}
5050
</div>
5151
<slot />
5252
</div>

packages/elements/src/checkpoint/CheckpointTrigger.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,15 @@ const buttonProps = {
2727
</script>
2828

2929
<template>
30-
<TooltipProvider v-if="props.tooltip">
30+
<TooltipProvider v-if="tooltip">
3131
<Tooltip>
3232
<TooltipTrigger as-child>
3333
<Button v-bind="{ ...buttonProps, ...$attrs }">
3434
<slot />
3535
</Button>
3636
</TooltipTrigger>
3737
<TooltipContent align="start" side="bottom">
38-
<p>{{ props.tooltip }}</p>
38+
<p>{{ tooltip }}</p>
3939
</TooltipContent>
4040
</Tooltip>
4141
</TooltipProvider>

packages/elements/src/conversation/Conversation.vue

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ const props = withDefaults(defineProps<Props>(), {
2626

2727
<template>
2828
<StickToBottom
29-
:aria-label="props.ariaLabel"
29+
:aria-label="ariaLabel"
3030
:class="cn('relative flex-1 overflow-y-hidden', props.class)"
3131
role="log"
32-
:initial="props.initial"
33-
:resize="props.resize"
34-
:damping="props.damping"
35-
:stiffness="props.stiffness"
36-
:mass="props.mass"
37-
:anchor="props.anchor"
32+
:initial="initial"
33+
:resize="resize"
34+
:damping="damping"
35+
:stiffness="stiffness"
36+
:mass="mass"
37+
:anchor="anchor"
3838
>
3939
<slot />
4040
</StickToBottom>

packages/elements/src/conversation/ConversationEmptyState.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,10 @@ const props = withDefaults(defineProps<Props>(), {
2929

3030
<div class="space-y-1">
3131
<h3 class="font-medium text-sm">
32-
{{ props.title }}
32+
{{ title }}
3333
</h3>
34-
<p v-if="props.description" class="text-muted-foreground text-sm">
35-
{{ props.description }}
34+
<p v-if="description" class="text-muted-foreground text-sm">
35+
{{ description }}
3636
</p>
3737
</div>
3838
</slot>

packages/elements/src/edge/Animated.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ const path = computed(() => {
7979
<template>
8080
<g v-if="path">
8181
<BaseEdge
82-
:id="props.id"
82+
:id="id"
8383
:marker-end="markerEnd"
8484
:path="path"
8585
:style="style"

packages/elements/src/edge/Temporary.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const path = computed(() => {
2020

2121
<template>
2222
<BaseEdge
23-
:id="props.id"
23+
:id="id"
2424
:path="path"
2525
class="stroke-1 stroke-ring"
2626
:style="{ strokeDasharray: '5, 5' }"

packages/elements/src/image/Image.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const src = computed(() => `data:${props.mediaType};base64,${props.base64}`)
2121

2222
<template>
2323
<img
24-
:alt="props.alt"
24+
:alt="alt"
2525
:class="classes"
2626
:src="src"
2727
v-bind="attrs"
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import { HoverCard } from '@repo/shadcn-vue/components/ui/hover-card'
33
4-
const props = withDefaults(defineProps<{
4+
withDefaults(defineProps<{
55
closeDelay?: number
66
openDelay?: number
77
}>(), {
@@ -11,7 +11,7 @@ const props = withDefaults(defineProps<{
1111
</script>
1212

1313
<template>
14-
<HoverCard :close-delay="props.closeDelay" :open-delay="props.openDelay">
14+
<HoverCard :close-delay="closeDelay" :open-delay="openDelay">
1515
<slot />
1616
</HoverCard>
1717
</template>

0 commit comments

Comments
 (0)