add user authentication
This commit is contained in:
30
web/src/components/ui/Button.tsx
Normal file
30
web/src/components/ui/Button.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { clsx } from "clsx";
|
||||
import { forwardRef, JSX } from "react";
|
||||
|
||||
const sizeClasses = {
|
||||
medium: "py-2 px-4",
|
||||
};
|
||||
|
||||
export type ButtonProps = JSX.IntrinsicElements["button"] & {
|
||||
size?: keyof typeof sizeClasses;
|
||||
};
|
||||
|
||||
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
||||
({ size = "medium", className, children, ...props }, ref) => {
|
||||
return (
|
||||
<button
|
||||
ref={ref}
|
||||
className={clsx(
|
||||
"border border-neutral-800 rounded-md not-disabled:cursor-pointer not-disabled:hover:bg-neutral-800 not-disabled:hover:text-white/90 disabled:cursor-not-allowed active:scale-95 transition duration-200",
|
||||
className,
|
||||
sizeClasses[size],
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
Button.displayName = "Button";
|
||||
Reference in New Issue
Block a user