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/ListTable/RowAction/index.tsx
import styles from './RowAction.module.scss';
import cx from 'classnames';

export default function RowAction({
    onClick = null,
    className = '',
    actionId = null,
    displayText,
    hiddenText = '',
    disabled = false,
    highlight = false,
    href = '',
    ariaLabel = '',
}) {
    if (href) {
        return (
            <a
                href={href}
                className={cx(styles.action, {[styles.delete]: highlight}, className)}
                aria-label={ariaLabel || displayText}
            >
                {displayText} {hiddenText && <span className="give-visually-hidden">{hiddenText}</span>}
            </a>
        );
    }

    if (!onClick) {
        return null;
    }

    return (
        <button
            type="button"
            onClick={onClick}
            data-actionid={actionId}
            className={cx(styles.action, {[styles.delete]: highlight}, className)}
            disabled={disabled}
            aria-label={ariaLabel || displayText}
        >
            {displayText} {hiddenText && <span className="give-visually-hidden">{hiddenText}</span>}
        </button>
    );
}