chain-frontend/src/widgets/chain-editor/ui/ChainEditor.tsx
2024-03-08 23:05:57 +07:00

53 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { Chain } from "@/entities/chain/schema";
import { RenameChainButton } from "@/features/rename-chain";
import { DeleteChainButton } from "@/features/delete-chain";
import { Typography } from "@mui/material";
import Breadcrumbs from "@mui/material/Breadcrumbs";
interface ChainEditorProps {
chain: Chain;
}
export default function ChainEditor({ chain }: ChainEditorProps) {
if (!chain.actions || chain.actions.length === 0)
return (
<>
<Breadcrumbs sx={{ fontSize: "24px" }}>
<Typography
variant="h5"
sx={{ color: "#4C4E64DE", opacity: "60%" }}
className="select-none"
>
{chain.name}
</Typography>
<Typography
variant="h5"
sx={{ color: "#4C4E64DE", opacity: "87%" }}
className="select-none"
>
Новый пост
</Typography>
</Breadcrumbs>
</>
);
return (
<div key={chain._id} className="flex items-center justify-between">
<Typography
variant="h5"
sx={{ color: "#4C4E64DE", opacity: "87%" }}
className="select-none"
>
{chain.name}
</Typography>
<div className="flex items-center gap-x-5">
<RenameChainButton chain={chain} />
<DeleteChainButton chain={chain} />
</div>
</div>
);
}