import type { EditorObject } from "../../../store/editorStore";
import Input from "@/components/Input";
import ColorPicker from "@/components/ColorPicker";

type LineSettingsProps = {
    selectedObject: EditorObject;
    onUpdate: (id: string, updates: Partial<EditorObject>) => void;
};

const LineSettings = ({ selectedObject, onUpdate }: LineSettingsProps) => {
    return (
        <>
            <ColorPicker
                label="رنگ خط"
                value={selectedObject.stroke || "#000000"}
                onChange={(value) => onUpdate(selectedObject.id, { stroke: value })}
            />
            <Input
                label="ضخامت خط"
                type="number"
                min={0}
                value={selectedObject.strokeWidth ?? 0}
                onChange={(e) =>
                    onUpdate(selectedObject.id, {
                        strokeWidth: parseInt(e.target.value) || 0,
                    })
                }
            />
        </>
    );
};

export default LineSettings;

