mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-02-11 05:35:25 +03:00
add type for deletion
This commit is contained in:
parent
bdcccb75df
commit
6dbb2f4a68
@ -15,7 +15,7 @@ import {
|
|||||||
} from "../ui/dialog";
|
} from "../ui/dialog";
|
||||||
import { Input } from "../ui/input";
|
import { Input } from "../ui/input";
|
||||||
import useKeyboardListener from "@/hooks/use-keyboard-listener";
|
import useKeyboardListener from "@/hooks/use-keyboard-listener";
|
||||||
import { Export } from "@/types/export";
|
import { DeleteClipType, Export } from "@/types/export";
|
||||||
import { MdEditSquare } from "react-icons/md";
|
import { MdEditSquare } from "react-icons/md";
|
||||||
import { baseUrl } from "@/api/baseUrl";
|
import { baseUrl } from "@/api/baseUrl";
|
||||||
|
|
||||||
@ -24,7 +24,7 @@ type ExportProps = {
|
|||||||
exportedRecording: Export;
|
exportedRecording: Export;
|
||||||
onSelect: (selected: Export) => void;
|
onSelect: (selected: Export) => void;
|
||||||
onRename: (original: string, update: string) => void;
|
onRename: (original: string, update: string) => void;
|
||||||
onDelete: ({ file: string, exportName: string }) => void;
|
onDelete: ({ file, exportName }: DeleteClipType) => void;
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function ExportCard({
|
export default function ExportCard({
|
||||||
|
|||||||
@ -12,7 +12,7 @@ import {
|
|||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
|
import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog";
|
||||||
import { Input } from "@/components/ui/input";
|
import { Input } from "@/components/ui/input";
|
||||||
import { Export } from "@/types/export";
|
import { DeleteClipType, Export } from "@/types/export";
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { useCallback, useEffect, useMemo, useState } from "react";
|
import { useCallback, useEffect, useMemo, useState } from "react";
|
||||||
import useSWR from "swr";
|
import useSWR from "swr";
|
||||||
@ -43,11 +43,6 @@ function Exports() {
|
|||||||
|
|
||||||
// Deleting
|
// Deleting
|
||||||
|
|
||||||
type DeleteClipType = {
|
|
||||||
file: string;
|
|
||||||
exportName: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
const [deleteClip, setDeleteClip] = useState<DeleteClipType | undefined>();
|
const [deleteClip, setDeleteClip] = useState<DeleteClipType | undefined>();
|
||||||
|
|
||||||
const onHandleDelete = useCallback(() => {
|
const onHandleDelete = useCallback(() => {
|
||||||
|
|||||||
@ -7,3 +7,8 @@ export type Export = {
|
|||||||
thumb_path: string;
|
thumb_path: string;
|
||||||
in_progress: boolean;
|
in_progress: boolean;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type DeleteClipType = {
|
||||||
|
file: string;
|
||||||
|
exportName: string;
|
||||||
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user