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

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

const AudioSettings = ({ selectedObject, onUpdate }: AudioSettingsProps) => {
    return (
        <>
            <Input
                label="نام فایل صوتی"
                value={selectedObject.audioName || ""}
                onChange={(e) => onUpdate(selectedObject.id, { audioName: e.target.value })}
                placeholder="مثلاً موسیقی پس‌زمینه"
            />
            <Input
                label="آدرس فایل صوتی"
                value={selectedObject.audioUrl || ""}
                onChange={(e) => onUpdate(selectedObject.id, { audioUrl: e.target.value })}
                placeholder="https://example.com/audio.mp3"
            />
            <SizeSettings
                selectedObject={selectedObject}
                onUpdate={onUpdate}
                defaultWidth={320}
                defaultHeight={56}
            />
        </>
    );
};

export default AudioSettings;
