Skip to content

Commit 932ab11

Browse files
committed
fix: handle undefine props
1 parent e77cae5 commit 932ab11

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

packages/ui/src/components/molecule/user-dialog/user-dialog.svelte

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
import { getShortenName } from '@repo/utils/src/ui.js'
55
66
interface Props {
7-
imageUrl: string
8-
name: string
9-
id: string
7+
imageUrl?: string
8+
name?: string
9+
id?: string
1010
}
1111
1212
let {
@@ -15,7 +15,7 @@
1515
id = undefined,
1616
}: Props = $props()
1717
18-
let shortenedName = $derived(getShortenName(name))
18+
let shortenedName = $derived(getShortenName(name ?? ''))
1919
2020
const items = [
2121
{

0 commit comments

Comments
 (0)