import { clx } from "@/helpers/utils"; import { Gallery, Grid8, MouseSquare, Shapes, Sticker, Text, VideoSquare, Music, Link2, } from "iconsax-react"; import type { ToolType } from "../../store/editorStore"; const tools: Array<{ icon: (color: string, variant?: "Bold" | "Outline" | "Broken" | "Bulk" | "Linear" | "TwoTone") => React.ReactNode; tool: ToolType; label: string }> = [ { icon: (color, variant) => , tool: "select", label: "انتخاب" }, { icon: (color, variant) => , tool: "rectangle", label: "اشکال" }, { icon: (color, variant) => , tool: "text", label: "متن" }, { icon: (color, variant) => , tool: "grid", label: "گرید" }, { icon: (color, variant) => , tool: "image", label: "گالری" }, { icon: (color, variant) => , tool: "link", label: "لینک" }, { icon: (color, variant) => , tool: "video", label: "ویدیو" }, { icon: (color, variant) => , tool: "audio", label: "صدا" }, { icon: (color, variant) => , tool: "sticker", label: "استیکر" }, ]; type ToolsBarProps = { tool: ToolType; onToolClick: (tool: ToolType) => void; }; const ToolsBar = ({ tool, onToolClick }: ToolsBarProps) => { return (
{tools.map((item, index) => { const isActive = item.tool === "rectangle" ? tool === "rectangle" || tool === "line" || tool === "arrow" || tool === "custom-shape" || tool === "pencil" : tool === item.tool; const iconColor = "black"; const iconVariant: "Bold" | "Outline" | "Broken" | "Bulk" | "Linear" | "TwoTone" | undefined = isActive ? "Bold" : "Outline"; return ( ); })}
); }; export default ToolsBar;