diff --git a/apps/desktop/src/chat/ChatWidget.tsx b/apps/desktop/src/chat/ChatWidget.tsx index 74d4435..190c824 100644 --- a/apps/desktop/src/chat/ChatWidget.tsx +++ b/apps/desktop/src/chat/ChatWidget.tsx @@ -133,7 +133,7 @@ function AudioWaveform({ }) { const playedBars = Math.round(progress * peaks.length) return ( -
+
{peaks.map((value, index) => { const height = Math.max(4, Math.round(value * 24)) const played = index <= playedBars @@ -191,7 +191,7 @@ function AudioAttachmentPlayer({ const decoded = await audioContext.decodeAudioData(buffer) await audioContext.close() if (!cancelled) { - setPeaks(extractPeaks(decoded)) + setPeaks(extractPeaks(decoded, 36)) } } catch (error) { console.error("Falha ao gerar waveform:", error) @@ -246,10 +246,11 @@ function AudioAttachmentPlayer({ const progress = duration > 0 ? currentTime / duration : 0 const sizeLabel = formatAttachmentSize(size) + const canSeek = duration > 0 return (
@@ -264,14 +265,34 @@ function AudioAttachmentPlayer({ {isPlaying ? : } -
- {isLoadingWaveform ? ( -
- ) : peaks.length > 0 ? ( - - ) : ( -
- )} +
+
{formatDuration(currentTime)} {sizeLabel ?? formatDuration(duration)} @@ -282,7 +303,9 @@ function AudioAttachmentPlayer({ type="button" onClick={handleDownload} className={`flex size-8 items-center justify-center rounded-md ${ - isAgent ? "text-white/70 hover:text-white" : "text-slate-500 hover:text-slate-700" + isAgent + ? "text-white/70 hover:bg-white/10 hover:text-white" + : "text-slate-500 hover:bg-slate-100 hover:text-slate-700" }`} aria-label="Baixar áudio" > @@ -1147,12 +1170,12 @@ export function ChatWidget({ ticketId, ticketRef }: ChatWidgetProps) { return (
-