We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5a5342e commit fb51bffCopy full SHA for fb51bff
packages/elements/src/prompt-input.tsx
@@ -357,21 +357,14 @@ export type PromptInputAttachmentsProps = Omit<
357
358
export function PromptInputAttachments({
359
children,
360
- className,
361
}: PromptInputAttachmentsProps) {
362
const attachments = usePromptInputAttachments();
363
364
- if (!attachments.files.length) {
365
- return null;
366
- }
367
-
368
- return (
369
- <div className={cn("flex flex-wrap gap-1 p-2.5", className)}>
370
- {attachments.files.map((file) => (
+ return attachments?.files.length > 0
+ ? attachments?.files.map((file) => (
371
<Fragment key={file.id}>{children(file)}</Fragment>
372
- ))}
373
- </div>
374
- );
+ ))
+ : null;
375
}
376
377
export type PromptInputActionAddAttachmentsProps = ComponentProps<
0 commit comments