import React, { useRef } from 'react'; import { type AriaButtonOptions, useButton } from 'react-aria'; import cn from '~/utils/cn'; export interface ButtonProps extends AriaButtonOptions<'button'> { variant?: 'heavy' | 'light' | 'danger'; className?: string; children?: React.ReactNode; ref?: React.RefObject; } export default function Button({ variant = 'light', ...props }: ButtonProps) { // In case the button is used as a trigger ref const ref = props.ref ?? useRef(null); const { buttonProps } = useButton(props, ref); return ( ); }