import type { ButtonHTMLAttributes, ReactNode } from "react";
import { cn } from "@/lib/cn";
type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
const buttonVariants: Record = {
primary: "bg-ctp-mauve text-ctp-crust hover:brightness-110",
secondary:
"border border-ctp-surface1 bg-ctp-surface0 text-ctp-text hover:bg-ctp-surface1",
ghost: "text-ctp-subtext0 hover:bg-ctp-surface0 hover:text-ctp-text",
danger: "border border-ctp-red/40 text-ctp-red hover:bg-ctp-red/15",
};
interface ButtonProps extends ButtonHTMLAttributes {
variant?: ButtonVariant;
}
export function Button({ variant = "primary", className, ...props }: ButtonProps) {
return (
);
}
export function Spinner({ className }: { className?: string }) {
return (
);
}
export function FullPageSpinner() {
return (
);
}
export function Field({
label,
children,
}: {
label: string;
children: ReactNode;
}) {
return (
);
}
export const inputClass =
"w-full rounded-md border border-ctp-surface0 bg-ctp-mantle px-3 py-2 text-sm text-ctp-text placeholder:text-ctp-overlay0 focus:border-ctp-mauve focus:outline-none";
export const linkButtonClass =
"inline-flex items-center justify-center gap-2 rounded-md border border-ctp-surface1 bg-ctp-surface0 px-3 py-1.5 text-sm font-medium text-ctp-text transition hover:bg-ctp-surface1";
export function EmptyState({
title,
description,
}: {
title: string;
description?: ReactNode;
}) {
return (
{title}
{description ? (
{description}
) : null}
);
}