({
size = 'M',
isInvalid = false,
isLoading = false,
isDisabled = false,
children
}: AttachmentCardProps)
| 593 | } |
| 594 | |
| 595 | export function AttachmentCard({ |
| 596 | size = 'M', |
| 597 | isInvalid = false, |
| 598 | isLoading = false, |
| 599 | isDisabled = false, |
| 600 | children |
| 601 | }: AttachmentCardProps) { |
| 602 | return ( |
| 603 | <div |
| 604 | aria-invalid={isInvalid || undefined} |
| 605 | aria-disabled={isDisabled || undefined} |
| 606 | className={attachmentCard({size, isInvalid, isLoading, isDisabled})}> |
| 607 | <Provider |
| 608 | values={[ |
| 609 | [ |
| 610 | ImageContext, |
| 611 | { |
| 612 | slots: { |
| 613 | thumbnail: { |
| 614 | alt: '', |
| 615 | styles: imageThumbnailStyles({isDisabled}) |
| 616 | } |
| 617 | } |
| 618 | } |
| 619 | ], |
| 620 | [ |
| 621 | TextContext, |
| 622 | { |
| 623 | slots: { |
| 624 | [DEFAULT_SLOT]: {}, |
| 625 | title: {styles: attachmentTitle({size, isDisabled})}, |
| 626 | description: {styles: attachmentDescription({size, isDisabled})} |
| 627 | } |
| 628 | } |
| 629 | ], |
| 630 | [ |
| 631 | ContentContext, |
| 632 | { |
| 633 | styles: attachmentContent, |
| 634 | // @ts-ignore |
| 635 | 'data-slot': 'content' |
| 636 | } |
| 637 | ] |
| 638 | ]}> |
| 639 | <ImageCoordinator>{children}</ImageCoordinator> |
| 640 | </Provider> |
| 641 | </div> |
| 642 | ); |
| 643 | } |
| 644 | |
| 645 | /** |
| 646 | * Attachment displays an individual file attachment within a PromptFieldAttachmentList. |
nothing calls this directly
no outgoing calls
no test coverage detected