forked from zhongyidian/food-add-edu
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
24 lines
560 B
TypeScript
24 lines
560 B
TypeScript
import { forwardRef } from "react";
|
|
import { cn } from "@/lib/cn";
|
|
import styles from "./Button.module.css";
|
|
import type { ButtonProps } from "./Button.types";
|
|
|
|
export const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
(
|
|
{ children, className, variant = "primary", size = "md", ...props },
|
|
ref,
|
|
) => {
|
|
return (
|
|
<button
|
|
ref={ref}
|
|
className={cn(styles.button, styles[variant], styles[size], className)}
|
|
{...props}
|
|
>
|
|
<span className={styles.content}>{children}</span>
|
|
</button>
|
|
);
|
|
},
|
|
);
|
|
|
|
Button.displayName = "Button";
|