mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
remove some slop
This commit is contained in:
@@ -43,6 +43,12 @@ import {
|
|||||||
Input,
|
Input,
|
||||||
} from "@chakra-ui/react";
|
} from "@chakra-ui/react";
|
||||||
const TranscriptCreate = () => {
|
const TranscriptCreate = () => {
|
||||||
|
|
||||||
|
const [isClient, setIsClient] = useState(false);
|
||||||
|
useEffect(() => {
|
||||||
|
// next SSR
|
||||||
|
setIsClient(true);
|
||||||
|
}, []);
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
const { isLoading, isAuthenticated } = useSessionStatus();
|
const { isLoading, isAuthenticated } = useSessionStatus();
|
||||||
const requireLogin = featureEnabled("requireLogin");
|
const requireLogin = featureEnabled("requireLogin");
|
||||||
@@ -68,13 +74,13 @@ const TranscriptCreate = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const send = () => {
|
const send = () => {
|
||||||
if (!isClient || loadingRecord || createTranscript.loading || permissionDenied) return;
|
if (loadingRecord || createTranscript.loading || permissionDenied) return;
|
||||||
setLoadingRecord(true);
|
setLoadingRecord(true);
|
||||||
createTranscript.create({ name, target_language: getTargetLanguage() });
|
createTranscript.create({ name, target_language: getTargetLanguage() });
|
||||||
};
|
};
|
||||||
|
|
||||||
const uploadFile = () => {
|
const uploadFile = () => {
|
||||||
if (!isClient || loadingUpload || createTranscript.loading || permissionDenied) return;
|
if (loadingUpload || createTranscript.loading || permissionDenied) return;
|
||||||
setLoadingUpload(true);
|
setLoadingUpload(true);
|
||||||
createTranscript.create({ name, target_language: getTargetLanguage() });
|
createTranscript.create({ name, target_language: getTargetLanguage() });
|
||||||
};
|
};
|
||||||
@@ -91,7 +97,7 @@ const TranscriptCreate = () => {
|
|||||||
if (createTranscript.error) setLoadingRecord(false);
|
if (createTranscript.error) setLoadingRecord(false);
|
||||||
}, [createTranscript.error]);
|
}, [createTranscript.error]);
|
||||||
|
|
||||||
const { loading, permissionOk, permissionDenied, requestPermission, isClient } =
|
const { loading, permissionOk, permissionDenied, requestPermission } =
|
||||||
useAudioDevice();
|
useAudioDevice();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
@@ -124,7 +130,7 @@ const TranscriptCreate = () => {
|
|||||||
Reflector is a transcription and summarization pipeline that
|
Reflector is a transcription and summarization pipeline that
|
||||||
transforms audio into knowledge.
|
transforms audio into knowledge.
|
||||||
<span className="hidden md:block">
|
<span className="hidden md:block">
|
||||||
{" "}The output is meeting minutes and topic summaries enabling
|
The output is meeting minutes and topic summaries enabling
|
||||||
topic-specific analyses stored in your systems of record. This is
|
topic-specific analyses stored in your systems of record. This is
|
||||||
accomplished on your infrastructure – without 3rd parties –
|
accomplished on your infrastructure – without 3rd parties –
|
||||||
keeping your data private, secure, and organized.
|
keeping your data private, secure, and organized.
|
||||||
@@ -205,7 +211,7 @@ const TranscriptCreate = () => {
|
|||||||
<Button
|
<Button
|
||||||
colorScheme="whiteAlpha"
|
colorScheme="whiteAlpha"
|
||||||
onClick={send}
|
onClick={send}
|
||||||
isDisabled={!isClient || !permissionOk || loadingRecord || loadingUpload}
|
isDisabled={!permissionOk || loadingRecord || loadingUpload}
|
||||||
mt={2}
|
mt={2}
|
||||||
>
|
>
|
||||||
{loadingRecord ? "Loading..." : "Record Meeting"}
|
{loadingRecord ? "Loading..." : "Record Meeting"}
|
||||||
|
|||||||
@@ -9,10 +9,9 @@ const useAudioDevice = () => {
|
|||||||
const [permissionDenied, setPermissionDenied] = useState<boolean>(false);
|
const [permissionDenied, setPermissionDenied] = useState<boolean>(false);
|
||||||
const [audioDevices, setAudioDevices] = useState<Option[]>([]);
|
const [audioDevices, setAudioDevices] = useState<Option[]>([]);
|
||||||
const [loading, setLoading] = useState(true);
|
const [loading, setLoading] = useState(true);
|
||||||
const [isClient, setIsClient] = useState(false);
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsClient(true);
|
// skips on SSR
|
||||||
checkPermission();
|
checkPermission();
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
@@ -23,12 +22,6 @@ const useAudioDevice = () => {
|
|||||||
}, [permissionOk]);
|
}, [permissionOk]);
|
||||||
|
|
||||||
const checkPermission = (): void => {
|
const checkPermission = (): void => {
|
||||||
// Skip on server-side rendering
|
|
||||||
if (typeof window === "undefined" || !navigator) {
|
|
||||||
setLoading(false);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (navigator.userAgent.includes("Firefox")) {
|
if (navigator.userAgent.includes("Firefox")) {
|
||||||
navigator.mediaDevices
|
navigator.mediaDevices
|
||||||
.getUserMedia({ audio: true, video: false })
|
.getUserMedia({ audio: true, video: false })
|
||||||
@@ -131,8 +124,7 @@ const useAudioDevice = () => {
|
|||||||
permissionDenied,
|
permissionDenied,
|
||||||
audioDevices,
|
audioDevices,
|
||||||
getAudioStream,
|
getAudioStream,
|
||||||
requestPermission,
|
requestPermission
|
||||||
isClient,
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import Image from "next/image";
|
|||||||
import { notFound } from "next/navigation";
|
import { notFound } from "next/navigation";
|
||||||
import useRoomMeeting from "../../[roomName]/useRoomMeeting";
|
import useRoomMeeting from "../../[roomName]/useRoomMeeting";
|
||||||
import dynamic from "next/dynamic";
|
import dynamic from "next/dynamic";
|
||||||
const WherebyEmbed = dynamic(() => import("../../lib/./WherebyWebinarEmbed"), {
|
const WherebyEmbed = dynamic(() => import("../../lib/WherebyWebinarEmbed"), {
|
||||||
ssr: false,
|
ssr: false,
|
||||||
});
|
});
|
||||||
import { FormEvent } from "react";
|
import { FormEvent } from "react";
|
||||||
|
|||||||
Reference in New Issue
Block a user