mock topics FE

This commit is contained in:
Sara
2023-12-07 17:06:01 +01:00
parent e15af5e1ef
commit f85c57bda1
2 changed files with 41 additions and 4 deletions

View File

@@ -0,0 +1,31 @@
[
{
"id": "27c07e49-d7a3-4b86-905c-f1a047366f91",
"title": "Issue one",
"summary": "The team discusses the first issue in the list",
"timestamp": 0.0,
"transcript": "",
"segments": [
{
"text": "Let's start with issue one, Alice you've been working on that, can you give an update ?",
"start": 0.0,
"speaker": 0
},
{
"text": "Yes, I've run into an issue with the task system but Bob helped me out and I have a POC ready, should I present it now ?",
"start": 0.38,
"speaker": 1
},
{
"text": "Yeah, I had to modify the task system because it didn't account for incoming blobs",
"start": 4.5,
"speaker": 2
},
{
"text": "Cool, yeah lets see it",
"start": 5.96,
"speaker": 0
}
]
}
]

View File

@@ -1,12 +1,10 @@
import { useEffect, useState } from "react";
import {
DefaultApi,
V1TranscriptGetTopicsRequest,
} from "../../api/apis/DefaultApi";
import { V1TranscriptGetTopicsRequest } from "../../api/apis/DefaultApi";
import { useError } from "../../(errors)/errorContext";
import { Topic } from "./webSocketTypes";
import getApi from "../../lib/getApi";
import { shouldShowError } from "../../lib/errorUtils";
import mockTopics from "./mockTopics.json";
type TranscriptTopics = {
topics: Topic[] | null;
@@ -21,6 +19,14 @@ const useTopics = (id: string): TranscriptTopics => {
const { setError } = useError();
const api = getApi();
useEffect(() => {
document.onkeyup = (e) => {
if (e.key === "t" && process.env.NEXT_PUBLIC_ENV === "development") {
setTopics(mockTopics);
}
};
});
useEffect(() => {
if (!id || !api) return;