Skip to content

Commit e4975f7

Browse files
details modal
1 parent 0ee4cec commit e4975f7

File tree

3 files changed

+42
-28
lines changed

3 files changed

+42
-28
lines changed

src/components/modal/index.tsx

+16-9
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ const Modal: FunctionComponent<ModalProps> = ({
1919
const { data, error, isLoading } = api.rooms.getRoomSummary.useQuery({
2020
roomName,
2121
});
22-
22+
console.log(data);
2323
// input array
2424
// output array-> contents [0].utterance
2525

@@ -58,16 +58,23 @@ const Modal: FunctionComponent<ModalProps> = ({
5858
as="h3"
5959
className="gradient-text text-lg font-medium leading-6"
6060
>
61-
Summary
61+
Meeting Details
6262
</Dialog.Title>
63-
<div className="mt-2">
64-
{isLoading && <Loader />}
65-
{data && (
63+
<div className="">
64+
{isLoading ? (
65+
<Loader />
66+
) : data ? (
67+
<div className="text-sm text-gray-100 text-opacity-50">
68+
{data.output[0].contents.length > 1 && (
69+
<Tabs
70+
summary={data.output[0].contents[1]?.utterance}
71+
transcriptions={data.input}
72+
/>
73+
)}
74+
</div>
75+
) : (
6676
<div className="text-sm text-gray-100 text-opacity-50">
67-
<Tabs
68-
summary={data.output[0].content[0].utterance}
69-
transcriptions={data.input}
70-
/>
77+
No summary available
7178
</div>
7279
)}
7380
</div>

src/components/tabs/index.tsx

+25-16
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { useState } from "react";
21
import { Tab } from "@headlessui/react";
32

43
function classNames(...classes: (string | undefined)[]) {
@@ -15,14 +14,14 @@ export default function Tabs({
1514
return (
1615
<div className="w-full max-w-md px-2 py-16 sm:px-0">
1716
<Tab.Group>
18-
<Tab.List className="flex space-x-1 rounded-xl bg-blue-900/20 p-1">
17+
<Tab.List className="flex gap-10 rounded-xl bg-gray-900/60 p-1">
1918
<Tab
2019
className={({ selected }) =>
2120
classNames(
22-
"w-full rounded-lg py-2.5 text-sm font-medium leading-5 text-blue-700",
23-
"ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2",
21+
"w-full rounded-lg py-2.5 text-sm font-medium leading-5 ",
22+
" ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2",
2423
selected
25-
? "bg-white shadow"
24+
? "bg-secondary/10 shadow"
2625
: "text-blue-100 hover:bg-white/[0.12] hover:text-white"
2726
)
2827
}
@@ -33,25 +32,35 @@ export default function Tabs({
3332
<Tab
3433
className={({ selected }) =>
3534
classNames(
36-
"w-full rounded-lg py-2.5 text-sm font-medium leading-5 text-blue-700",
35+
"w-full rounded-lg py-2.5 text-sm font-medium leading-5 ",
3736
"ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2",
3837
selected
39-
? "bg-white shadow"
38+
? "bg-secondary-300/10 shadow"
4039
: "text-blue-100 hover:bg-white/[0.12] hover:text-white"
4140
)
4241
}
4342
>
44-
Transcriptions
43+
Transcription
4544
</Tab>
4645
</Tab.List>
47-
<Tab.Panels className="mt-2">
48-
<Tab.Panel
49-
className={classNames(
50-
"rounded-xl bg-white p-3",
51-
"ring-white ring-opacity-60 ring-offset-2 ring-offset-blue-400 focus:outline-none focus:ring-2"
52-
)}
53-
>
54-
46+
<Tab.Panels className="mt-2 space-x-10">
47+
<Tab.Panel>
48+
<p className="text-lg text-white">{summary}</p>
49+
</Tab.Panel>
50+
<Tab.Panel>
51+
{transcriptions.map((transcription: any, index) => {
52+
return (
53+
<div className="bg-white-opacity-5 w-full p-2" key={index}>
54+
<h2 className="gradient-text">{transcription?.speaker}</h2>
55+
<p className="font-lg text-white">
56+
{transcription.utterance}
57+
</p>
58+
<div className="text-sm font-bold text-gray-100 text-opacity-50">
59+
{transcription.timestamp}
60+
</div>
61+
</div>
62+
);
63+
})}
5564
</Tab.Panel>
5665
</Tab.Panels>
5766
</Tab.Group>

src/server/api/routers/rooms.ts

+1-3
Original file line numberDiff line numberDiff line change
@@ -167,9 +167,7 @@ export const roomsRouter = createTRPCRouter({
167167
timestamp: transcript.createdAt.toISOString(),
168168
}));
169169
if (chatLog.length === 0) {
170-
return {
171-
data: null,
172-
};
170+
return null;
173171
}
174172

175173
const apiKey = process.env.ONEAI_API_KEY;

0 commit comments

Comments
 (0)