- Add dynamic sitemap.xml generation for all pages - Add robots.txt for search engine crawl directives - Add LocalBusiness JSON-LD schema for local SEO - Add BreadcrumbList schema for navigation breadcrumbs - Add canonical URLs to all product pages - Add Twitter Cards metadata - Add Google Analytics 4 integration component - Create llm.txt with all product data for AI optimization - Create reusable UI components (Button, Card, Badge) - Update company address to full Thai address - Update .env.example with GA4 placeholder
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
import { ButtonHTMLAttributes, forwardRef } from 'react';
|
|
import { cn } from '@/lib/utils';
|
|
|
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
|
|
size?: 'sm' | 'md' | 'lg';
|
|
}
|
|
|
|
const Button = forwardRef<HTMLButtonElement, ButtonProps>(
|
|
({ className, variant = 'primary', size = 'md', children, ...props }, ref) => {
|
|
return (
|
|
<button
|
|
ref={ref}
|
|
className={cn(
|
|
'inline-flex items-center justify-center font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 disabled:pointer-events-none disabled:opacity-50',
|
|
// Variants
|
|
{
|
|
'bg-primary-600 text-white hover:bg-primary-700 active:bg-primary-800': variant === 'primary',
|
|
'bg-secondary-100 text-secondary-900 hover:bg-secondary-200': variant === 'secondary',
|
|
'border-2 border-primary-600 text-primary-600 hover:bg-primary-50': variant === 'outline',
|
|
'text-secondary-600 hover:bg-secondary-100': variant === 'ghost',
|
|
},
|
|
// Sizes
|
|
{
|
|
'px-3 py-1.5 text-sm rounded': size === 'sm',
|
|
'px-4 py-2 text-base rounded-md': size === 'md',
|
|
'px-6 py-3 text-lg rounded-lg': size === 'lg',
|
|
},
|
|
className
|
|
)}
|
|
{...props}
|
|
>
|
|
{children}
|
|
</button>
|
|
);
|
|
}
|
|
);
|
|
|
|
Button.displayName = 'Button';
|
|
|
|
export { Button };
|
|
export type { ButtonProps };
|