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

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

const TransformSettings = ({ selectedObject, onUpdate }: TransformSettingsProps) => {
    return (
        <div className="pt-4 flex flex-col gap-4 border-t border-border">
            <Input
                label="موقعیت X"
                type="number"
                value={Math.round(selectedObject.x)}
                onChange={(e) =>
                    onUpdate(selectedObject.id, {
                        x: parseInt(e.target.value) || 0,
                    })
                }
            />
            <Input
                label="موقعیت Y"
                type="number"
                value={Math.round(selectedObject.y)}
                onChange={(e) =>
                    onUpdate(selectedObject.id, {
                        y: parseInt(e.target.value) || 0,
                    })
                }
            />
            <Input
                label="چرخش (درجه)"
                type="number"
                value={selectedObject.rotation || 0}
                onChange={(e) =>
                    onUpdate(selectedObject.id, {
                        rotation: parseInt(e.target.value) || 0,
                    })
                }
            />
        </div>
    );
};

export default TransformSettings;

