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

interface TravelActionProps {
    loadCapacity: {
        value: string;
        min: number;
        max: number;
        defaultValue: string;
        onChange: (value: string) => void;
    };
    unloadDuration: {
        value: string;
        min: number;
        max: number;
        defaultValue: string;
        onChange: (value: string) => void;
    };
    pickPoint?: {
        value: string;
        onChange: (value: string) => void;
    };
    unloadPoint?: {
        value: string;
        onChange: (value: string) => void;
    };
}

const TravelAction: React.FC<TravelActionProps> = ({
    loadCapacity,
    unloadDuration,
    pickPoint,
    unloadPoint,
}) => {
    return (
        <>
            <InputWithDropDown
                label="Load Capacity"
                value={loadCapacity.value}
                min={loadCapacity.min}
                max={loadCapacity.max}
                defaultValue={loadCapacity.defaultValue}
                step={0.1}
                activeOption="s"
                onClick={() => { }}
                onChange={loadCapacity.onChange}
            />
            <InputWithDropDown
                label="Unload Duration"
                value={unloadDuration.value}
                min={unloadDuration.min}
                max={unloadDuration.max}
                defaultValue={unloadDuration.defaultValue}
                step={0.1}
                activeOption="s"
                onClick={() => { }}
                onChange={unloadDuration.onChange}
            />
            {pickPoint && (
                <EyeDropInput
                    label="Pick Point"
                    value={pickPoint.value}
                    onChange={pickPoint.onChange}
                />
            )}
            {unloadPoint && (
                <EyeDropInput
                    label="Unload Point"
                    value={unloadPoint.value}
                    onChange={unloadPoint.onChange}
                />
            )}
        </>
    );
};

export default TravelAction;
