link-stack/apps/bridge-frontend/app/_components/Detail.tsx

36 lines
835 B
TypeScript
Raw Normal View History

2024-03-16 19:39:20 +01:00
"use client";
import { FC } from "react";
2024-04-23 13:36:51 +02:00
import { Grid, Box, Dialog } from "@mui/material";
2024-03-16 19:39:20 +01:00
import { useRouter } from "next/navigation";
import { typography } from "@/app/_styles/theme";
interface DetailProps {
title: string;
entity: string;
children: any;
}
export const Detail: FC<DetailProps> = ({ title, entity, children }) => {
const router = useRouter();
const { h3 } = typography;
return (
2024-04-23 13:36:51 +02:00
<Dialog
open={true}
onClose={() => router.push(`/${entity}`)}
fullScreen
sx={{ backgroundColor: "#ddd" }}
>
<Box sx={{ height: "100vh", backgroundColor: "#ddd", p: 3 }}>
<Grid container direction="column">
<Grid item>
<Box sx={h3}>{title}</Box>
</Grid>
<Grid item>{children}</Grid>
2024-03-16 19:39:20 +01:00
</Grid>
2024-04-23 13:36:51 +02:00
</Box>
</Dialog>
2024-03-16 19:39:20 +01:00
);
};