Skip to content

Commit 2631a83

Browse files
committed
Update prompt-input.tsx
1 parent fb51bff commit 2631a83

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

packages/elements/src/prompt-input.tsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -360,11 +360,13 @@ export function PromptInputAttachments({
360360
}: PromptInputAttachmentsProps) {
361361
const attachments = usePromptInputAttachments();
362362

363-
return attachments?.files.length > 0
364-
? attachments?.files.map((file) => (
365-
<Fragment key={file.id}>{children(file)}</Fragment>
366-
))
367-
: null;
363+
if (!attachments.files.length) {
364+
return null;
365+
}
366+
367+
return attachments.files.map((file) => (
368+
<Fragment key={file.id}>{children(file)}</Fragment>
369+
));
368370
}
369371

370372
export type PromptInputActionAddAttachmentsProps = ComponentProps<

0 commit comments

Comments
 (0)