Files
dpage-editor/src/pages/editor/components/sidebar/ToolInstructions.tsx
T
hamid zarghami 83b2fd809c
deploy to danak / build_and_deploy (push) Has been cancelled
gallery:
2026-05-25 09:35:57 +03:30

47 lines
1.0 KiB
TypeScript

import { type ToolType } from "@/pages/editor/store/editorStore";
import {
ImageGallery,
VideoInput,
LinkInput,
SelectInstruction,
RectangleInstruction,
TextInstruction,
LineInstruction,
ArrowInstruction,
StickerInstruction,
GridInstruction,
} from "./instructions";
type ToolInstructionsProps = {
tool: ToolType;
};
const ToolInstructions = ({ tool }: ToolInstructionsProps) => {
if (tool === "image") {
return <ImageGallery />;
}
if (tool === "video") {
return <VideoInput />;
}
if (tool === "link") {
return <LinkInput />;
}
const simpleInstructions: Partial<Record<ToolType, React.ReactElement>> = {
select: <SelectInstruction />,
rectangle: <RectangleInstruction />,
text: <TextInstruction />,
line: <LineInstruction />,
arrow: <ArrowInstruction />,
sticker: <StickerInstruction />,
grid: <GridInstruction />,
};
return simpleInstructions[tool] ?? null;
};
export default ToolInstructions;