forked from BasedHardware/omi
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
46 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
frontend/src/components/memories/summary/memory-with-tabs.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
'use client'; | ||
|
||
import { Fragment, useState } from 'react'; | ||
import Tabs from '../tabs'; | ||
import Summary from './sumary'; | ||
import Transcription from '../transcript/transcription'; | ||
import { Memory } from '@/src/types/memory.types'; | ||
|
||
interface MemoryWithTabsProps { | ||
memory: Memory; | ||
} | ||
|
||
export default function MemoryWithTabs({ memory }: MemoryWithTabsProps) { | ||
const [currentTab, setCurrentTab] = useState('sum'); | ||
return ( | ||
<Fragment> | ||
<Tabs currentTab={currentTab} setCurrentTab={setCurrentTab} /> | ||
<div className=""> | ||
{currentTab === 'sum' ? ( | ||
<Summary memory={memory} /> | ||
) : ( | ||
<Transcription | ||
transcript={memory.transcript_segments} | ||
externalData={memory.external_data} | ||
/> | ||
)} | ||
</div> | ||
</Fragment> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,29 @@ | ||
import Link from 'next/link'; | ||
'use client'; | ||
|
||
export default function Tabs({ currentTab }: { currentTab: string }) { | ||
interface TabsProps { | ||
currentTab: string; | ||
setCurrentTab: (tab: string) => void; | ||
} | ||
|
||
export default function Tabs({ currentTab, setCurrentTab }: TabsProps) { | ||
return ( | ||
<div className="mt-8 flex border-y border-solid border-zinc-800 text-base md:mt-10 md:text-lg"> | ||
<Link | ||
href="?tab=trs" | ||
<button | ||
onClick={() => setCurrentTab('trs')} | ||
className={`${ | ||
currentTab === 'trs' ? 'bg-zinc-800' : 'hover:bg-zinc-900' | ||
} w-full py-3 text-center transition-colors`} | ||
> | ||
Transcript | ||
</Link> | ||
<Link | ||
href="?tab=sum" | ||
</button> | ||
<button | ||
onClick={() => setCurrentTab('sum')} | ||
className={`${ | ||
currentTab === 'sum' ? 'bg-zinc-800' : 'hover:bg-zinc-900' | ||
} w-full py-3 text-center transition-colors`} | ||
> | ||
Summary | ||
</Link> | ||
</button> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters