mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-06-26 06:11:54 +03:00
Some checks are pending
CI / AMD64 Build (push) Waiting to run
CI / Assemble and push default build (push) Blocked by required conditions
CI / ARM Build (push) Waiting to run
CI / Jetson Jetpack 6 (push) Waiting to run
CI / AMD64 Extra Build (push) Blocked by required conditions
CI / ARM Extra Build (push) Blocked by required conditions
CI / Synaptics Build (push) Blocked by required conditions
* improve visibility of blurred icon buttons * add motion search to history actions menu and mobile drawer * i18n * use pure css for motion search dialog video * defer profile restoration until subscribers are connected * change order of features in mobile review settings drawer
66 lines
1.9 KiB
TypeScript
66 lines
1.9 KiB
TypeScript
import {
|
|
DropdownMenu,
|
|
DropdownMenuContent,
|
|
DropdownMenuItem,
|
|
DropdownMenuTrigger,
|
|
} from "../ui/dropdown-menu";
|
|
import { Button } from "../ui/button";
|
|
import { useTranslation } from "react-i18next";
|
|
import { FaFilm } from "react-icons/fa6";
|
|
|
|
type ActionsDropdownProps = {
|
|
onDebugReplayClick?: () => void;
|
|
onExportClick: () => void;
|
|
onShareTimestampClick: () => void;
|
|
onMotionSearchClick?: () => void;
|
|
};
|
|
|
|
export default function ActionsDropdown({
|
|
onDebugReplayClick,
|
|
onExportClick,
|
|
onShareTimestampClick,
|
|
onMotionSearchClick,
|
|
}: Readonly<ActionsDropdownProps>) {
|
|
const { t } = useTranslation([
|
|
"components/dialog",
|
|
"views/replay",
|
|
"views/events",
|
|
"common",
|
|
]);
|
|
|
|
return (
|
|
<DropdownMenu>
|
|
<DropdownMenuTrigger asChild>
|
|
<Button
|
|
className="flex items-center gap-2"
|
|
aria-label={t("menu.actions", { ns: "common" })}
|
|
size="sm"
|
|
>
|
|
<FaFilm className="size-5 text-secondary-foreground" />
|
|
<div className="text-primary">
|
|
{t("menu.actions", { ns: "common" })}
|
|
</div>
|
|
</Button>
|
|
</DropdownMenuTrigger>
|
|
<DropdownMenuContent align="end">
|
|
<DropdownMenuItem onClick={onExportClick}>
|
|
{t("menu.export", { ns: "common" })}
|
|
</DropdownMenuItem>
|
|
<DropdownMenuItem onClick={onShareTimestampClick}>
|
|
{t("recording.shareTimestamp.label", { ns: "components/dialog" })}
|
|
</DropdownMenuItem>
|
|
{onMotionSearchClick && (
|
|
<DropdownMenuItem onClick={onMotionSearchClick}>
|
|
{t("motionSearch.menuItem", { ns: "views/events" })}
|
|
</DropdownMenuItem>
|
|
)}
|
|
{onDebugReplayClick && (
|
|
<DropdownMenuItem onClick={onDebugReplayClick}>
|
|
{t("title", { ns: "views/replay" })}
|
|
</DropdownMenuItem>
|
|
)}
|
|
</DropdownMenuContent>
|
|
</DropdownMenu>
|
|
);
|
|
}
|