import { type ToolType } from "@/pages/editor/store/editorStore";
import {
    ImageGallery,
    VideoInput,
    AudioInput,
    LinkInput,
    SelectInstruction,
    RectangleInstruction,
    TextInstruction,
    StickerInstruction,
    GridInstruction,
} from "./instructions";

type ToolInstructionsProps = {
    tool: ToolType;
};

const ToolInstructions = ({ tool }: ToolInstructionsProps) => {
    if (tool === "image") {
        return <ImageGallery />;
    }

    if (tool === "video") {
        return <VideoInput />;
    }

    if (tool === "audio") {
        return <AudioInput />;
    }

    if (tool === "link") {
        return <LinkInput />;
    }

    const simpleInstructions: Partial<Record<ToolType, React.ReactElement>> = {
        select: <SelectInstruction />,
        rectangle: <RectangleInstruction />,
        line: <RectangleInstruction />,
        arrow: <RectangleInstruction />,
        pencil: <RectangleInstruction />,
        "custom-shape": <RectangleInstruction />,
        text: <TextInstruction />,
        sticker: <StickerInstruction />,
        grid: <GridInstruction />,
    };

    return simpleInstructions[tool] ?? null;
};

export default ToolInstructions;

