mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-29 05:31:51 +02:00
Better dir structure
This commit is contained in:
24
src-web/components/Button.tsx
Normal file
24
src-web/components/Button.tsx
Normal 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}
|
||||
/>
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user