add type for deletion

This commit is contained in:
Josh Hawkins 2024-04-20 08:39:26 -05:00
parent bdcccb75df
commit 6dbb2f4a68
3 changed files with 8 additions and 8 deletions

View File

@ -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({

View File

@ -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<DeleteClipType | undefined>();
const onHandleDelete = useCallback(() => {

View File

@ -7,3 +7,8 @@ export type Export = {
thumb_path: string;
in_progress: boolean;
};
export type DeleteClipType = {
file: string;
exportName: string;
};