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 }) {
    return (
        <ToggleControl
            label={label}
            help={help}
            checked={checked}
            onChange={onChange}
        />
    );
}

export function NextTextControl({ label, help, value, onChange, placeholder }) {
    return (
        <TextControl
            label={label}
            help={help}
            value={value}
            onChange={onChange}
            placeholder={placeholder}
        />
    );
}

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 }) {
    return (
        <NumberControl
            label={label}
            help={help}
            value={value}
            onChange={onChange}
            min={min}
            max={max}
            placeholder={placeholder}
        />
    );
}
