Better dir structure

This commit is contained in:
Gregory Schier
2023-02-18 20:30:39 -08:00
parent 51b6147445
commit bfa3418ee5
21 changed files with 8 additions and 6 deletions

View File

@@ -0,0 +1,24 @@
import classnames from 'classnames';
import { ButtonHTMLAttributes, forwardRef } from 'react';
type Props = ButtonHTMLAttributes<HTMLButtonElement> & {
color?: 'primary' | 'secondary';
};
export const Button = forwardRef<HTMLButtonElement, Props>(function Button(
{ className, color = 'primary', ...props }: Props,
ref,
) {
return (
<button
ref={ref}
className={classnames(
className,
'h-10 px-5 rounded-lg text-white',
{ 'bg-blue-500': color === 'primary' },
{ 'bg-violet-500': color === 'secondary' },
)}
{...props}
/>
);
});