add action editor

This commit is contained in:
Robert 2024-03-09 00:14:04 +07:00
parent dd30941fd4
commit 5ff78c461b
No known key found for this signature in database
GPG Key ID: F631C7FD957D5F22

View File

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