'use client'; import type { AnchorHTMLAttributes } from 'react'; import { cn } from '@/lib/utils'; import { AdminLink } from './admin-link'; const VARIANTS = { default: 'bg-primary text-primary-foreground hover:bg-primary/90 shadow-sm hover:shadow', outline: 'border border-input bg-background hover:bg-accent hover:text-accent-foreground', ghost: 'hover:bg-accent hover:text-accent-foreground', } as const; interface AdminButtonLinkProps extends AnchorHTMLAttributes { href: string; variant?: keyof typeof VARIANTS; /** A link out of the panel (a hard navigation) rather than to another admin page. */ external?: boolean; } /** A link that looks like a small Button, for actions that open a page. */ export function AdminButtonLink({ href, variant = 'outline', external, className, children, ...rest }: AdminButtonLinkProps) { const classes = cn( 'inline-flex h-9 items-center justify-center gap-2 rounded-md px-3 text-sm font-medium transition-all duration-200', 'focus-visible:outline-hidden', VARIANTS[variant], className, ); if (external) { return {children}; } return {children}; }