mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-20 20:29:06 +00:00
* feat: limit the amount of transcripts to 10 by default * feat: separate page into different component, greatly improving the loading and reactivity * fix: current implementation immediately invokes the onDelete and onReprocess From pr-agent-monadical: Suggestion: The current implementation immediately invokes the onDelete and onReprocess functions when the component renders, rather than when the menu items are clicked. This can cause unexpected behavior and potential memory leaks. Use callback functions that only execute when the menu items are actually clicked. [possible issue, importance: 9]
63 lines
1.3 KiB
TypeScript
63 lines
1.3 KiB
TypeScript
import React from "react";
|
|
import { Icon, Tooltip } from "@chakra-ui/react";
|
|
import {
|
|
FaCheck,
|
|
FaTrash,
|
|
FaStar,
|
|
FaMicrophone,
|
|
FaGear,
|
|
} from "react-icons/fa6";
|
|
|
|
interface TranscriptStatusIconProps {
|
|
status: string;
|
|
}
|
|
|
|
export default function TranscriptStatusIcon({
|
|
status,
|
|
}: TranscriptStatusIconProps) {
|
|
switch (status) {
|
|
case "ended":
|
|
return (
|
|
<Tooltip label="Processing done">
|
|
<span>
|
|
<Icon color="green" as={FaCheck} />
|
|
</span>
|
|
</Tooltip>
|
|
);
|
|
case "error":
|
|
return (
|
|
<Tooltip label="Processing error">
|
|
<span>
|
|
<Icon color="red.500" as={FaTrash} />
|
|
</span>
|
|
</Tooltip>
|
|
);
|
|
case "idle":
|
|
return (
|
|
<Tooltip label="New meeting, no recording">
|
|
<span>
|
|
<Icon color="yellow.500" as={FaStar} />
|
|
</span>
|
|
</Tooltip>
|
|
);
|
|
case "processing":
|
|
return (
|
|
<Tooltip label="Processing in progress">
|
|
<span>
|
|
<Icon color="gray.500" as={FaGear} />
|
|
</span>
|
|
</Tooltip>
|
|
);
|
|
case "recording":
|
|
return (
|
|
<Tooltip label="Recording in progress">
|
|
<span>
|
|
<Icon color="blue.500" as={FaMicrophone} />
|
|
</span>
|
|
</Tooltip>
|
|
);
|
|
default:
|
|
return null;
|
|
}
|
|
}
|