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

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

const TextSettings = ({ selectedObject, onUpdate }: TextSettingsProps) => {
    return (
        <>
            <Input
                label="متن"
                value={selectedObject.text || ""}
                onChange={(e) => onUpdate(selectedObject.id, { text: e.target.value })}
            />
            <Input
                label="اندازه فونت"
                type="number"
                value={selectedObject.fontSize || 24}
                onChange={(e) =>
                    onUpdate(selectedObject.id, {
                        fontSize: parseInt(e.target.value) || 24,
                    })
                }
            />
            <Input
                label="رنگ متن"
                type="color"
                value={selectedObject.fill || "#000000"}
                onChange={(e) => onUpdate(selectedObject.id, { fill: e.target.value })}
            />
        </>
    );
};

export default TextSettings;

