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