From 0be6f72d87770e247c5426d21608b079cd34399e Mon Sep 17 00:00:00 2001 From: Sergey Mankovsky Date: Fri, 14 Jun 2024 16:12:38 +0200 Subject: [PATCH] Move waveform back to the top --- .../transcripts/[transcriptId]/page.tsx | 29 +++++++-------- .../[transcriptId]/record/page.tsx | 35 ++++++++++--------- 2 files changed, 33 insertions(+), 31 deletions(-) diff --git a/www/app/[domain]/transcripts/[transcriptId]/page.tsx b/www/app/[domain]/transcripts/[transcriptId]/page.tsx index 93022ed4..5faa31e1 100644 --- a/www/app/[domain]/transcripts/[transcriptId]/page.tsx +++ b/www/app/[domain]/transcripts/[transcriptId]/page.tsx @@ -59,10 +59,24 @@ export default function TranscriptDetails(details: TranscriptDetails) { <> + {waveform.waveform && mp3.media && topics.topics ? ( + + ) : waveform.error ? ( +
"error loading this recording"
+ ) : ( + + )} )} - {waveform.waveform && mp3.media && topics.topics ? ( - - ) : waveform.error ? ( -
"error loading this recording"
- ) : ( - - )}
); diff --git a/www/app/[domain]/transcripts/[transcriptId]/record/page.tsx b/www/app/[domain]/transcripts/[transcriptId]/record/page.tsx index fd767e08..fa60ec56 100644 --- a/www/app/[domain]/transcripts/[transcriptId]/record/page.tsx +++ b/www/app/[domain]/transcripts/[transcriptId]/record/page.tsx @@ -31,7 +31,7 @@ const TranscriptRecord = (details: TranscriptDetails) => { const router = useRouter(); const [status, setStatus] = useState( - webSockets.status.value || transcript.response?.status || "idle", + webSockets.status.value || transcript.response?.status || "idle" ); useEffect(() => { @@ -61,25 +61,11 @@ const TranscriptRecord = (details: TranscriptDetails) => { return ( - - - {status == "processing" && // todo send an event when the mp3 is ready webSockets.waveform && webSockets.duration && @@ -97,6 +83,21 @@ const TranscriptRecord = (details: TranscriptDetails) => { // todo: only start recording animation when you get "recorded" status )} + + + ); };