Skip to content

Commit

Permalink
fix: handle undefine props
Browse files Browse the repository at this point in the history
  • Loading branch information
NhongSun committed Jan 16, 2025
1 parent e77cae5 commit 932ab11
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
import { getShortenName } from '@repo/utils/src/ui.js'
interface Props {
imageUrl: string
name: string
id: string
imageUrl?: string
name?: string
id?: string
}
let {
Expand All @@ -15,7 +15,7 @@
id = undefined,
}: Props = $props()
let shortenedName = $derived(getShortenName(name))
let shortenedName = $derived(getShortenName(name ?? ''))
const items = [
{
Expand Down

0 comments on commit 932ab11

Please sign in to comment.