From 6dbb2f4a683c44e029e1a27a27fd6366dace9c8f Mon Sep 17 00:00:00 2001 From: Josh Hawkins <32435876+hawkeye217@users.noreply.github.com> Date: Sat, 20 Apr 2024 08:39:26 -0500 Subject: [PATCH] add type for deletion --- web/src/components/card/ExportCard.tsx | 4 ++-- web/src/pages/Exports.tsx | 7 +------ web/src/types/export.ts | 5 +++++ 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/web/src/components/card/ExportCard.tsx b/web/src/components/card/ExportCard.tsx index 6e436edf0..86ec9c7ce 100644 --- a/web/src/components/card/ExportCard.tsx +++ b/web/src/components/card/ExportCard.tsx @@ -15,7 +15,7 @@ import { } from "../ui/dialog"; import { Input } from "../ui/input"; 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 { baseUrl } from "@/api/baseUrl"; @@ -24,7 +24,7 @@ type ExportProps = { exportedRecording: Export; onSelect: (selected: Export) => void; onRename: (original: string, update: string) => void; - onDelete: ({ file: string, exportName: string }) => void; + onDelete: ({ file, exportName }: DeleteClipType) => void; }; export default function ExportCard({ diff --git a/web/src/pages/Exports.tsx b/web/src/pages/Exports.tsx index d9affd817..f0cf5748d 100644 --- a/web/src/pages/Exports.tsx +++ b/web/src/pages/Exports.tsx @@ -12,7 +12,7 @@ import { import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogTitle } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; -import { Export } from "@/types/export"; +import { DeleteClipType, Export } from "@/types/export"; import axios from "axios"; import { useCallback, useEffect, useMemo, useState } from "react"; import useSWR from "swr"; @@ -43,11 +43,6 @@ function Exports() { // Deleting - type DeleteClipType = { - file: string; - exportName: string; - }; - const [deleteClip, setDeleteClip] = useState(); const onHandleDelete = useCallback(() => { diff --git a/web/src/types/export.ts b/web/src/types/export.ts index 499e33313..fc62bbeec 100644 --- a/web/src/types/export.ts +++ b/web/src/types/export.ts @@ -7,3 +7,8 @@ export type Export = { thumb_path: string; in_progress: boolean; }; + +export type DeleteClipType = { + file: string; + exportName: string; +};