Implemented suggestions by Matthieu

This commit is contained in:
Andreas
2024-01-01 10:31:43 +07:00
parent c66385b0d0
commit c603e279df
9 changed files with 65 additions and 106 deletions

View File

@@ -18,11 +18,11 @@ import { SESSION_COOKIE_NAME } from "../lib/fief";
const poppins = Poppins({ subsets: ["latin"], weight: ["200", "400", "600"] });
export const viewport: Viewport = {
themeColor: 'black',
themeColor: "black",
width: "device-width",
initialScale: 1,
maximumScale: 1,
}
};
export const metadata: Metadata = {
metadataBase: new URL(process.env.DEV_URL || "https://reflector.media"),

View File

@@ -75,8 +75,7 @@ const TranscriptRecord = (details: TranscriptDetails) => {
}, [webSockets.status.value, transcript.response?.status]);
useEffect(() => {
if (transcript.response?.status === "ended")
mp3.getNow();
if (transcript.response?.status === "ended") mp3.getNow();
}, [transcript.response]);
useEffect(() => {

View File

@@ -35,7 +35,7 @@ const useCreateTranscript = (): UseTranscript => {
);
setErrorState(err);
setLoading(false);
})
});
};
return { transcript, loading, error, create };

View File

@@ -21,11 +21,10 @@ export default function FileUploadButton(props: FileUploadButton) {
console.log("Calling api.v1TranscriptRecordUpload()...");
// Create an object of the expected type
const uploadData: Body_transcript_record_upload_v1_transcripts__transcript_id__record_upload_post =
{
file: file,
// Add other properties if required by the type definition
};
const uploadData = {
file: file,
// Add other properties if required by the type definition
};
api?.v1TranscriptRecordUpload(props.transcriptId, uploadData);
}

View File

@@ -86,29 +86,28 @@ const ShareLink = (props: ShareLinkProps) => {
)}
{isOwner && api && (
<div className="relative">
<SelectSearch
className="select-search--top select-search"
options={[
{ name: "Private", value: "private" },
{ name: "Secure", value: "semi-private" },
{ name: "Public", value: "public" },
]}
value={shareMode?.toString()}
onChange={updateShareMode}
closeOnSelect={true}
/>
{shareLoading && (
<div className="h-4 w-4 absolute top-1/3 right-3 z-10">
<FontAwesomeIcon
icon={faSpinner}
className="animate-spin-slow text-gray-600 flex-grow rounded-lg md:rounded-xl h-4 w-4"
/>
</div>
)}
</div>
)}
<div className="relative">
<SelectSearch
className="select-search--top select-search"
options={[
{ name: "Private", value: "private" },
{ name: "Secure", value: "semi-private" },
{ name: "Public", value: "public" },
]}
value={shareMode?.toString()}
onChange={updateShareMode}
closeOnSelect={true}
/>
{shareLoading && (
<div className="h-4 w-4 absolute top-1/3 right-3 z-10">
<FontAwesomeIcon
icon={faSpinner}
className="animate-spin-slow text-gray-600 flex-grow rounded-lg md:rounded-xl h-4 w-4"
/>
</div>
)}
</div>
)}
</div>
)}
{!requireLogin && (

View File

@@ -59,37 +59,37 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
useEffect(() => {
document.onkeyup = (e) => {
if (e.key === "a" && process.env.NEXT_PUBLIC_ENV === "development") {
const segments : GetTranscriptSegmentTopic[] = [
{
speaker: 1,
start: 0,
text: "This is the transcription of an example title",
},
{
speaker: 2,
start: 10,
text: "This is the second speaker",
},
{
speaker: 3,
start: 90,
text: "This is the third speaker",
},
{
speaker: 4,
start: 90,
text: "This is the fourth speaker",
},
{
speaker: 5,
start: 123,
text: "This is the fifth speaker",
},
{
speaker: 6,
start: 300,
text: "This is the sixth speaker",
}
const segments: GetTranscriptSegmentTopic[] = [
{
speaker: 1,
start: 0,
text: "This is the transcription of an example title",
},
{
speaker: 2,
start: 10,
text: "This is the second speaker",
},
{
speaker: 3,
start: 90,
text: "This is the third speaker",
},
{
speaker: 4,
start: 90,
text: "This is the fourth speaker",
},
{
speaker: 5,
start: 123,
text: "This is the fifth speaker",
},
{
speaker: 6,
start: 300,
text: "This is the sixth speaker",
},
];
setTranscriptText("Lorem Ipsum");
@@ -310,8 +310,7 @@ export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
if (!transcriptId || !api) return;
api?.v1TranscriptGetWebsocketEvents(transcriptId).then((result) => {
});
api?.v1TranscriptGetWebsocketEvents(transcriptId).then((result) => {});
const url = `${websocket_url}/v1/transcripts/${transcriptId}/events`;
let ws = new WebSocket(url);