Add TTRPG Player marketing landing site.
React/Vite landing with RU/EN i18n, live USD pricing, download links to updates.mailib.ru, and donate.stream checkout. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
import type { ReactNode } from "react";
|
||||
|
||||
import styles from "./Button.module.css";
|
||||
|
||||
type ButtonVariant = "primary" | "secondary" | "ghost" | "gold";
|
||||
|
||||
type ButtonProps = {
|
||||
children: ReactNode;
|
||||
href?: string;
|
||||
variant?: ButtonVariant;
|
||||
className?: string;
|
||||
onClick?: () => void;
|
||||
type?: "button" | "submit";
|
||||
};
|
||||
|
||||
function join(...parts: (string | undefined)[]): string {
|
||||
return parts.filter(Boolean).join(" ");
|
||||
}
|
||||
|
||||
export function Button({
|
||||
children,
|
||||
href,
|
||||
variant = "primary",
|
||||
className,
|
||||
onClick,
|
||||
type = "button",
|
||||
}: ButtonProps) {
|
||||
const cls = join(styles.button, styles[variant], className);
|
||||
|
||||
if (href) {
|
||||
return (
|
||||
<a className={cls} href={href}>
|
||||
{children}
|
||||
</a>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<button className={cls} type={type} onClick={onClick}>
|
||||
{children}
|
||||
</button>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user