diff --git a/.changeset/proud-rocks-study.md b/.changeset/proud-rocks-study.md new file mode 100644 index 00000000..8c99d123 --- /dev/null +++ b/.changeset/proud-rocks-study.md @@ -0,0 +1,5 @@ +--- +"ai-elements": patch +--- + +Fix type error in InlineCitationCardTrigger by checking sources[0] directly diff --git a/packages/elements/src/inline-citation.tsx b/packages/elements/src/inline-citation.tsx index 27fd0213..1f49b828 100644 --- a/packages/elements/src/inline-citation.tsx +++ b/packages/elements/src/inline-citation.tsx @@ -68,7 +68,7 @@ export const InlineCitationCardTrigger = ({ variant="secondary" {...props} > - {sources.length ? ( + {sources[0] ? ( <> {new URL(sources[0]).hostname}{" "} {sources.length > 1 && `+${sources.length - 1}`}