Chore: frontend infrastructure upgrade (#16420)
Co-authored-by: NFish <douxc512@gmail.com> Co-authored-by: zxhlyh <jasonapring2015@outlook.com> Co-authored-by: twwu <twwu@dify.ai> Co-authored-by: jZonG <jzongcode@gmail.com>
This commit is contained in:
@@ -49,8 +49,8 @@ const VoiceInput = ({
|
||||
const ctx = ctxRef.current!
|
||||
const dataUnit8Array = recorder.current.getRecordAnalyseData()
|
||||
const dataArray = [].slice.call(dataUnit8Array)
|
||||
const lineLength = parseInt(`${canvas.width / 3}`)
|
||||
const gap = parseInt(`${1024 / lineLength}`)
|
||||
const lineLength = Number.parseInt(`${canvas.width / 3}`)
|
||||
const gap = Number.parseInt(`${1024 / lineLength}`)
|
||||
|
||||
ctx.clearRect(0, 0, canvas.width, canvas.height)
|
||||
ctx.beginPath()
|
||||
@@ -161,15 +161,15 @@ const VoiceInput = ({
|
||||
}
|
||||
}, [])
|
||||
|
||||
const minutes = parseInt(`${parseInt(`${originDuration}`) / 60}`)
|
||||
const seconds = parseInt(`${originDuration}`) % 60
|
||||
const minutes = Number.parseInt(`${Number.parseInt(`${originDuration}`) / 60}`)
|
||||
const seconds = Number.parseInt(`${originDuration}`) % 60
|
||||
|
||||
return (
|
||||
<div className={cn(s.wrapper, 'absolute inset-0 rounded-xl')}>
|
||||
<div className='absolute inset-[1.5px] flex items-center pl-[14.5px] pr-[6.5px] py-[14px] bg-primary-25 rounded-[10.5px] overflow-hidden'>
|
||||
<canvas id='voice-input-record' className='absolute left-0 bottom-0 w-full h-4' />
|
||||
<div className='absolute inset-[1.5px] flex items-center overflow-hidden rounded-[10.5px] bg-primary-25 py-[14px] pl-[14.5px] pr-[6.5px]'>
|
||||
<canvas id='voice-input-record' className='absolute bottom-0 left-0 h-4 w-full' />
|
||||
{
|
||||
startConvert && <RiLoader2Line className='animate-spin mr-2 w-4 h-4 text-primary-700' />
|
||||
startConvert && <RiLoader2Line className='mr-2 h-4 w-4 animate-spin text-primary-700' />
|
||||
}
|
||||
<div className='grow'>
|
||||
{
|
||||
@@ -190,20 +190,20 @@ const VoiceInput = ({
|
||||
{
|
||||
startRecord && (
|
||||
<div
|
||||
className='flex justify-center items-center mr-1 w-8 h-8 hover:bg-primary-100 rounded-lg cursor-pointer'
|
||||
className='mr-1 flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-primary-100'
|
||||
onClick={handleStopRecorder}
|
||||
>
|
||||
<StopCircle className='w-5 h-5 text-primary-600' />
|
||||
<StopCircle className='h-5 w-5 text-primary-600' />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
{
|
||||
startConvert && (
|
||||
<div
|
||||
className='flex justify-center items-center mr-1 w-8 h-8 hover:bg-gray-200 rounded-lg cursor-pointer'
|
||||
className='mr-1 flex h-8 w-8 cursor-pointer items-center justify-center rounded-lg hover:bg-gray-200'
|
||||
onClick={onCancel}
|
||||
>
|
||||
<RiCloseLine className='w-4 h-4 text-gray-500' />
|
||||
<RiCloseLine className='h-4 w-4 text-gray-500' />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
Reference in New Issue
Block a user