"use client"; import { FC, useState } from "react"; import { Box, Grid } from "@mui/material"; import { useRouter } from "next/navigation"; import { Dialog, Button, colors, typography } from "ui"; interface DetailProps { title: string; entity: string; id: string; children: any; deleteAction?: Function; } export const Detail: FC = ({ title, entity, id, children, deleteAction, }) => { const router = useRouter(); const { almostBlack } = colors; const { bodyLarge } = typography; const [showDeleteConfirmation, setShowDeleteConfirmation] = useState(false); const continueDeleteAction = async () => { await deleteAction?.(id); setShowDeleteConfirmation(false); router.push(`/${entity}`); }; return ( <> router.push(`/${entity}`)} buttons={ {deleteAction && ( ); };