import {
    ToggleControl,
    TextControl,
    TextareaControl,
    __experimentalNumberControl as NumberControl,
} from "@wordpress/components";

// Wrapper components that handle the WordPress component quirks
export function NextToggleControl({ label, help, checked, onChange, disabled }) {
    return (
        <ToggleControl
            label={label}
            help={help}
            checked={checked}
            onChange={onChange}
            disabled={disabled}
        />
    );
}

export function NextTextControl({ label, help, value, onChange, type = "text", className = "" }) {
    return (
        <TextControl
            label={label}
            className={className}
            type={type}
            help={help}
            value={value}
            onChange={onChange}
        />
    );
}

export function NextTextareaControl({ label, help, value, onChange, rows = 6 }) {
    return (
        <TextareaControl
            label={label}
            help={help}
            value={value}
            onChange={onChange}
            rows={rows}
        />
    );
}

export function NextNumberControl({
    label,
    help,
    value,
    onChange,
    min,
    max,
    placeholder,
    disabled,
}) {
    return (
        <NumberControl
            label={label}
            help={help}
            value={value}
            onChange={onChange}
            min={min}
            max={max}
            placeholder={placeholder}
            disabled={disabled}
        />
    );
}
