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

interface WorkerActionProps {
    loadCount: {
        value: number;
        min: number;
        max: number;
        step: number;
        defaultValue: string,
        disabled: false,
        onChange: (value: number) => void;
    };
}

const WorkerAction: React.FC<WorkerActionProps> = ({
    loadCount
}) => {
    return (
        <div className="pillarJib-action-container">
            {loadCount && (
                <InputWithDropDown
                    label="Max Load Count"
                    value={loadCount.value.toString()}
                    min={loadCount.min}
                    max={loadCount.max}
                    disabled={loadCount.disabled}
                    defaultValue={loadCount.defaultValue}
                    step={loadCount.step}
                    activeOption="unit"
                    onClick={() => { }}
                    onChange={(value) => loadCount.onChange(parseInt(value))}
                />
            )}
        </div>
    );
};

export default WorkerAction;