/* * Copyright (c) 2021 - 2023, Ludvig Lundgren and the autobrr contributors. * SPDX-License-Identifier: GPL-2.0-or-later */ import { FC, Fragment, MutableRefObject } from "react"; import { Dialog, Transition } from "@headlessui/react"; import { ExclamationTriangleIcon } from "@heroicons/react/24/solid"; import { SectionLoader } from "@components/SectionLoader"; interface ModalUpperProps { title: string; text: string; } interface ModalLowerProps { isOpen: boolean; isLoading: boolean; toggle: () => void; deleteAction: () => void; } interface DeleteModalProps extends ModalUpperProps, ModalLowerProps { buttonRef: MutableRefObject | undefined; } const ModalUpper = ({ title, text }: ModalUpperProps) => (
); const ModalLower = ({ isOpen, isLoading, toggle, deleteAction }: ModalLowerProps) => (
{isLoading ? ( ) : ( <> )}
); export const DeleteModal: FC = (props: DeleteModalProps) => (
);