HEX
Server: LiteSpeed
System: Linux server315.web-hosting.com 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
User: globfdxw (6114)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/globfdxw/www/wp-content/plugins/give/src/Views/Components/AdminUI/Input/index.tsx
import {ChangeEventHandler, forwardRef} from 'react';

import './style.scss';

interface InputProps {
    name?: string;
    value?: string;
    placeholder?: string;
    type?: string;
    onChange?: ChangeEventHandler<HTMLInputElement>;
    disabled?: boolean;
    label?: string;
    [x: string]: any;
}

const Input = forwardRef<HTMLInputElement, InputProps>(
    ({name, value, placeholder, onChange, label, disabled = false, type = 'text', ...rest}, ref) => {

        const Input = () => (
            <input
                ref={ref}
                type={type}
                name={name}
                aria-label={name}
                placeholder={placeholder}
                className="givewp-input"
                onChange={onChange}
                disabled={disabled}
                value={value}
                {...rest}
            />
        )

        if (label) {
            return (
                <label className="label">
                    {Input()}
                    {label}
                </label>
            )
        }

        return Input();
    })

export default Input