Skip to content

Commit fb51bff

Browse files
committed
Update prompt-input.tsx
1 parent 5a5342e commit fb51bff

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

packages/elements/src/prompt-input.tsx

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -357,21 +357,14 @@ export type PromptInputAttachmentsProps = Omit<
357357

358358
export function PromptInputAttachments({
359359
children,
360-
className,
361360
}: PromptInputAttachmentsProps) {
362361
const attachments = usePromptInputAttachments();
363362

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) => (
363+
return attachments?.files.length > 0
364+
? attachments?.files.map((file) => (
371365
<Fragment key={file.id}>{children(file)}</Fragment>
372-
))}
373-
</div>
374-
);
366+
))
367+
: null;
375368
}
376369

377370
export type PromptInputActionAddAttachmentsProps = ComponentProps<

0 commit comments

Comments
 (0)