| | |
| | | type Option = { |
| | | value: string |
| | | label: string |
| | | icon: React.JSX.Element |
| | | icon: JSX.Element |
| | | } |
| | | type FileUploaderInAttachmentProps = { |
| | | fileConfig: FileUpload |
| | |
| | | { |
| | | value: TransferMethod.local_file, |
| | | label: t('common.fileUploader.uploadFromComputer'), |
| | | icon: <RiUploadCloud2Line className='h-4 w-4' />, |
| | | icon: <RiUploadCloud2Line className='w-4 h-4' />, |
| | | }, |
| | | { |
| | | value: TransferMethod.remote_url, |
| | | label: t('common.fileUploader.pasteFileLink'), |
| | | icon: <RiLink className='h-4 w-4' />, |
| | | icon: <RiLink className='w-4 h-4' />, |
| | | }, |
| | | ] |
| | | |
| | |
| | | <Button |
| | | key={option.value} |
| | | variant='tertiary' |
| | | className={cn('relative grow', open && 'bg-components-button-tertiary-bg-hover')} |
| | | className={cn('grow relative', open && 'bg-components-button-tertiary-bg-hover')} |
| | | disabled={!!(fileConfig.number_limits && files.length >= fileConfig.number_limits)} |
| | | > |
| | | {option.icon} |