file uploader

This commit is contained in:
StyleZhang 2024-08-12 16:24:13 +08:00
parent efcd462a69
commit 079c802b5c
6 changed files with 9 additions and 3 deletions

View File

@ -87,6 +87,7 @@ const ChatInputArea = ({
ref={holdSpaceRef}
speechToTextConfig={speechToTextConfig}
onShowVoiceInput={handleShowVoiceInput}
onSend={handleSend}
/>
)

View File

@ -17,10 +17,12 @@ import cn from '@/utils/classnames'
type OperationProps = {
speechToTextConfig?: EnableType
onShowVoiceInput?: () => void
onSend: () => void
}
const Operation = forwardRef<HTMLDivElement, OperationProps>(({
speechToTextConfig,
onShowVoiceInput,
onSend,
}, ref) => {
return (
<div
@ -48,6 +50,7 @@ const Operation = forwardRef<HTMLDivElement, OperationProps>(({
<Button
className='ml-3 px-0 w-8'
variant='primary'
onClick={onSend}
>
<RiSendPlane2Fill className='w-4 h-4' />
</Button>

View File

@ -44,7 +44,7 @@ const FileFromLinkOrLocal = ({
<div className='flex items-center p-1 h-8 bg-components-input-bg-active border border-components-input-border-active rounded-lg shadow-xs'>
<input
className='grow block mr-0.5 px-1 bg-transparent system-sm-regular outline-none appearance-none'
placeholder='Enter URL...'
placeholder={t('common.fileUploader.pasteFileLinkInputPlaceholder') || ''}
value={url}
onChange={e => setUrl(e.target.value)}
/>

View File

@ -37,7 +37,7 @@ const FileUploaderInAttachment = () => {
<Button
key={option.value}
variant='tertiary'
className={cn('grow', open && 'bg-components-button-tertiary-bg-hover')}
className={cn('basis-1/2', open && 'bg-components-button-tertiary-bg-hover')}
>
{option.icon}
<span className='ml-1'>{option.label}</span>

View File

@ -554,7 +554,8 @@ const translation = {
},
fileUploader: {
uploadFromComputer: 'Local upload',
pasteImageLink: 'Paste file link',
pasteFileLink: 'Paste file link',
pasteFileLinkInputPlaceholder: 'Enter URL...',
},
tag: {
placeholder: 'All Tags',

View File

@ -551,6 +551,7 @@ const translation = {
fileUploader: {
uploadFromComputer: '从本地上传',
pasteFileLink: '粘贴文件链接',
pasteFileLinkInputPlaceholder: '输入文件链接',
},
tag: {
placeholder: '全部标签',