mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
Removed unnecessary suffix "Type"
This commit is contained in:
@@ -6,15 +6,15 @@ import {
|
|||||||
} from "@fortawesome/free-solid-svg-icons";
|
} from "@fortawesome/free-solid-svg-icons";
|
||||||
import { formatTime } from "../lib/time";
|
import { formatTime } from "../lib/time";
|
||||||
import ScrollToBottom from "./scrollToBottom";
|
import ScrollToBottom from "./scrollToBottom";
|
||||||
import FinalSummary from "./finalSummary";
|
|
||||||
import DisconnectedIndicator from "./disconnectedIndicator";
|
import DisconnectedIndicator from "./disconnectedIndicator";
|
||||||
import LiveTrancription from "./liveTranscription";
|
import LiveTrancription from "./liveTranscription";
|
||||||
import { TopicType, FinalSummaryType } from "./webSocketTypes";
|
import FinalSummary from "./finalSummary";
|
||||||
|
import { Topic, FinalSummary as FinalSummaryType } from "./webSocketTypes";
|
||||||
|
|
||||||
type DashboardProps = {
|
type DashboardProps = {
|
||||||
transcriptionText: string;
|
transcriptionText: string;
|
||||||
finalSummary: FinalSummaryType;
|
finalSummary: FinalSummaryType;
|
||||||
topics: TopicType[];
|
topics: Topic[];
|
||||||
disconnected: boolean;
|
disconnected: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -3,14 +3,14 @@ import { DefaultApi, V1TranscriptsCreateRequest } from "../api/apis/DefaultApi";
|
|||||||
import { Configuration } from "../api/runtime";
|
import { Configuration } from "../api/runtime";
|
||||||
import { GetTranscript } from "../api";
|
import { GetTranscript } from "../api";
|
||||||
|
|
||||||
type UseTranscriptReturnType = {
|
type UseTranscript = {
|
||||||
response: GetTranscript | null;
|
response: GetTranscript | null;
|
||||||
loading: boolean;
|
loading: boolean;
|
||||||
error: string | null;
|
error: string | null;
|
||||||
createTranscript: () => void;
|
createTranscript: () => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
const useTranscript = (): UseTranscriptReturnType => {
|
const useTranscript = (): UseTranscript => {
|
||||||
const [response, setResponse] = useState<GetTranscript | null>(null);
|
const [response, setResponse] = useState<GetTranscript | null>(null);
|
||||||
const [loading, setLoading] = useState<boolean>(false);
|
const [loading, setLoading] = useState<boolean>(false);
|
||||||
const [error, setError] = useState<string | null>(null);
|
const [error, setError] = useState<string | null>(null);
|
||||||
|
|||||||
@@ -1,22 +1,20 @@
|
|||||||
import { useEffect, useState } from "react";
|
import { useEffect, useState } from "react";
|
||||||
import { TopicType, FinalSummaryType, StatusType } from "./webSocketTypes";
|
import { Topic, FinalSummary, Status } from "./webSocketTypes";
|
||||||
|
|
||||||
type UseWebSocketsReturnType = {
|
type UseWebSockets = {
|
||||||
transcriptText: string;
|
transcriptText: string;
|
||||||
topics: TopicType[];
|
topics: Topic[];
|
||||||
finalSummary: FinalSummaryType;
|
finalSummary: FinalSummary;
|
||||||
status: StatusType;
|
status: Status;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const useWebSockets = (
|
export const useWebSockets = (transcriptId: string | null): UseWebSockets => {
|
||||||
transcriptId: string | null,
|
|
||||||
): UseWebSocketsReturnType => {
|
|
||||||
const [transcriptText, setTranscriptText] = useState<string>("");
|
const [transcriptText, setTranscriptText] = useState<string>("");
|
||||||
const [topics, setTopics] = useState<TopicType[]>([]);
|
const [topics, setTopics] = useState<Topic[]>([]);
|
||||||
const [finalSummary, setFinalSummary] = useState<FinalSummaryType>({
|
const [finalSummary, setFinalSummary] = useState<FinalSummary>({
|
||||||
summary: "",
|
summary: "",
|
||||||
});
|
});
|
||||||
const [status, setStatus] = useState<StatusType>({ value: "disconnected" });
|
const [status, setStatus] = useState<Status>({ value: "disconnected" });
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (!transcriptId) return;
|
if (!transcriptId) return;
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
export type TopicType = {
|
export type Topic = {
|
||||||
timestamp: number;
|
timestamp: number;
|
||||||
title: string;
|
title: string;
|
||||||
transcript: string;
|
transcript: string;
|
||||||
@@ -6,14 +6,14 @@ export type TopicType = {
|
|||||||
id: string;
|
id: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type TranscriptType = {
|
export type Transcript = {
|
||||||
text: string;
|
text: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type FinalSummaryType = {
|
export type FinalSummary = {
|
||||||
summary: string;
|
summary: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
export type StatusType = {
|
export type Status = {
|
||||||
value: string;
|
value: string;
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user