mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
use topic object instead timestamp
This commit is contained in:
@@ -78,9 +78,7 @@ export function Dashboard({
|
|||||||
<div
|
<div
|
||||||
className="flex justify-between items-center cursor-pointer px-4"
|
className="flex justify-between items-center cursor-pointer px-4"
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
setActiveTopic(
|
setActiveTopic(activeTopic?.id == item.id ? null : item)
|
||||||
activeTopic == item.timestamp ? null : item.timestamp,
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className="w-1/4">{formatTime(item.timestamp)}</div>
|
<div className="w-1/4">{formatTime(item.timestamp)}</div>
|
||||||
@@ -89,14 +87,14 @@ export function Dashboard({
|
|||||||
<FontAwesomeIcon
|
<FontAwesomeIcon
|
||||||
className={`transform transition-transform duration-200`}
|
className={`transform transition-transform duration-200`}
|
||||||
icon={
|
icon={
|
||||||
activeTopic == item.timestamp
|
activeTopic?.id == item.id
|
||||||
? faChevronDown
|
? faChevronDown
|
||||||
: faChevronRight
|
: faChevronRight
|
||||||
}
|
}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{activeTopic == item.timestamp && (
|
{activeTopic?.id == item.id && (
|
||||||
<div className="p-2 mt-2 -mb-2 bg-slate-50 rounded">
|
<div className="p-2 mt-2 -mb-2 bg-slate-50 rounded">
|
||||||
{item.transcript}
|
{item.transcript}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -138,7 +138,7 @@ export default function Recorder(props) {
|
|||||||
});
|
});
|
||||||
region.on("click", (e) => {
|
region.on("click", (e) => {
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
setActiveTopic(region.start);
|
setActiveTopic(topic);
|
||||||
wavesurfer.setTime(region.start);
|
wavesurfer.setTime(region.start);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -164,7 +164,7 @@ export default function Recorder(props) {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (activeTopic) {
|
if (activeTopic) {
|
||||||
wavesurfer.setTime(activeTopic);
|
wavesurfer.setTime(activeTopic.timestamp);
|
||||||
}
|
}
|
||||||
}, [activeTopic]);
|
}, [activeTopic]);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user