import React from "react";
import InputRange from "../../../../../ui/inputs/InputRange";
import SwapAction from "./SwapAction";

interface AssemblyActionProps {
    processTime: {
        value: number;
        min: number;
        max: number;
        disabled?: boolean,
        onChange: (value: number) => void;
    };
    swapOptions: string[];
    swapDefaultOption: string;
    onSwapSelect: (value: string) => void;
    clearPoints: () => void;
}

const AssemblyAction: React.FC<AssemblyActionProps> = ({
    processTime,
    swapOptions,
    swapDefaultOption,
    onSwapSelect,
    clearPoints
}) => {
    return (
        <>
            <InputRange
                label="Process Time"
                value={processTime.value}
                min={processTime.min}
                max={processTime.max}
                disabled={processTime.disabled}
                onClick={() => { }}
                onChange={processTime.onChange}
            />
            <SwapAction
                options={swapOptions}
                defaultOption={swapDefaultOption}
                onSelect={onSwapSelect}
            />
            <div className="selected-actions-list">
                <div className="value-field-container">
                    <div className="label">Reset Points</div>
                    <button
                        id="reset-button"
                        type="button"
                        className="regularDropdown-container"
                        onClick={clearPoints}
                    >
                        Clear
                    </button>
                </div>
            </div>
        </>
    );
};

export default AssemblyAction;
