import React from "react";
import InputWithDropDown from "../../../../../ui/inputs/InputWithDropDown";
import LabledDropdown from "../../../../../ui/inputs/LabledDropdown";

interface StorageActionProps {
    maxCapacity: string;
    spawnedCount: string;
    min: number;
    max?: number;
    maxCapacityDefault: string;
    spawnedCountCefault: string;
    currentMaterialType: string;
    handleCapacityChange: (value: string) => void;
    handleSpawnCountChange: (value: string) => void;
    handleMaterialTypeChange: (value: string) => void;
}

const StorageAction: React.FC<StorageActionProps> = ({ maxCapacity, spawnedCount, min, max, maxCapacityDefault, spawnedCountCefault, currentMaterialType, handleCapacityChange, handleSpawnCountChange, handleMaterialTypeChange }) => {
    return (
        <>
            <InputWithDropDown
                key={'Storage Capacity'}
                label="Storage Capacity"
                value={maxCapacity}
                min={min}
                step={1}
                max={max}
                defaultValue={maxCapacityDefault}
                activeOption="unit"
                onClick={() => { }}
                onChange={handleCapacityChange}
            />
            <InputWithDropDown
                key={"Spawn Count"}
                label="Spawn Count"
                value={spawnedCount}
                min={min}
                step={1}
                max={max}
                defaultValue={spawnedCountCefault}
                activeOption="unit"
                onClick={() => { }}
                onChange={handleSpawnCountChange}
            />
            <LabledDropdown
                label={"Material Type"}
                defaultOption={currentMaterialType}
                options={["Default material", "Material 1", "Material 2", "Material 3"]}
                onSelect={handleMaterialTypeChange}
            />
        </>
    );
};

export default StorageAction;
