'use client'; import { ButtonHTMLAttributes, DetailedHTMLProps, FC, useEffect, useRef, useState, } from 'react'; import { clsx } from 'clsx'; const ReactLoading = ({ color = '#fff', width = 20, height = 20 }: { type?: string; color?: string; width?: number; height?: number }) => { const size = Math.min(width, height); const borderWidth = Math.max(2, Math.round(size / 8)); return (
); }; export const Button: FC< DetailedHTMLProps< ButtonHTMLAttributes, HTMLButtonElement > & { secondary?: boolean; loading?: boolean; innerClassName?: string; } > = ({ children, loading, innerClassName, secondary, ...props }) => { const ref = useRef(null); const [height, setHeight] = useState(null); useEffect(() => { setHeight(ref.current?.offsetHeight || 40); }, []); return ( ); };