Auth front-end

This commit is contained in:
Koper
2023-08-18 19:29:02 +07:00
parent 327911c43e
commit 733054428e
15 changed files with 234 additions and 43 deletions

View File

@@ -26,12 +26,7 @@ const App = () => {
const webSockets = useWebSockets(transcript.response?.id);
return (
<div className="flex flex-col items-center h-[100svh] bg-gradient-to-r from-[#8ec5fc30] to-[#e0c3fc42]">
<div className="h-[13svh] flex flex-col justify-center items-center">
<h1 className="text-5xl font-bold text-blue-500">Reflector</h1>
<p className="text-gray-500">Capture The Signal, Not The Noise</p>
</div>
<>
<Recorder
setStream={setStream}
onStop={() => {
@@ -48,7 +43,7 @@ const App = () => {
topics={webSockets.topics}
disconnected={disconnected}
/>
</div>
</>
);
};

View File

@@ -2,6 +2,7 @@ import { useEffect, useState } from "react";
import { DefaultApi, V1TranscriptsCreateRequest } from "../api/apis/DefaultApi";
import { Configuration } from "../api/runtime";
import { GetTranscript } from "../api";
import getApi from "../lib/getApi";
type UseTranscript = {
response: GetTranscript | null;
@@ -15,11 +16,7 @@ const useTranscript = (): UseTranscript => {
const [loading, setLoading] = useState<boolean>(false);
const [error, setError] = useState<string | null>(null);
const apiConfiguration = new Configuration({
basePath: process.env.NEXT_PUBLIC_API_URL,
// accessToken:
});
const api = new DefaultApi(apiConfiguration);
const api = getApi();
const createTranscript = () => {
setLoading(true);

View File

@@ -5,6 +5,7 @@ import {
V1TranscriptRecordWebrtcRequest,
} from "../api/apis/DefaultApi";
import { Configuration } from "../api/runtime";
import getApi from "../lib/getApi";
const useWebRTC = (
stream: MediaStream | null,
@@ -17,10 +18,7 @@ const useWebRTC = (
return;
}
const apiConfiguration = new Configuration({
basePath: process.env.NEXT_PUBLIC_API_URL,
});
const api = new DefaultApi(apiConfiguration);
const api = getApi();
let p: Peer = new Peer({ initiator: true, stream: stream });