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

interface WorkerActionProps {
    loadCapacity: {
        value: string;
        min: number;
        max: number;
        step: number;
        defaultValue: string;
        disabled?: boolean,
        onChange: (value: string) => void;
    };
    clearPoints: () => void;
}

const WorkerAction: React.FC<WorkerActionProps> = ({
    loadCapacity,
    clearPoints,
}) => {
    return (
        <>
            <InputWithDropDown
                label="Load Capacity"
                value={loadCapacity.value}
                min={loadCapacity.min}
                max={loadCapacity.max}
                disabled={loadCapacity.disabled}
                defaultValue={loadCapacity.defaultValue}
                step={loadCapacity.step}
                activeOption="unit"
                onClick={() => { }}
                onChange={loadCapacity.onChange}
            />
            <div className="selected-actions-list">
                <div className="value-field-container">
                    <div className="label">Reset</div>
                    <button
                        id="rest-button"
                        type="button"
                        className="regularDropdown-container"
                        onClick={() => {
                            clearPoints();
                        }}
                    >
                        Clear
                    </button>
                </div>
            </div>
        </>
    );
};

export default WorkerAction;
