morethanadiagnosis-hub/web/components/common/Link.tsx
Claude 1c0680b1de
feat: implement frontend home screen with API navigation
- Built responsive home page with navigation to API docs
- Created feature cards highlighting API capabilities
- Configured Next.js for static export
- Updated nginx to serve frontend static files
- Added nginx service to docker-compose configurations
- Fixed TypeScript issues in auth components

Components updated:
- web/app/page.tsx: Complete home page redesign
- web/components/common/Checkbox.tsx: Support ReactNode labels
- web/components/common/Link.tsx: Add onClick handler support
- web/app/(auth)/reset-password/confirm/page.tsx: Suspense boundary

Infrastructure:
- backend/nginx.conf: Serve static files from /usr/share/nginx/html
- backend/docker-compose.yml: Added nginx service
- backend/docker-compose.prod.yml: Mount frontend build output
- web/next.config.js: Static export configuration

Job ID: MTAD-IMPL-2025-11-18-CL
2025-11-18 05:50:21 +00:00

52 lines
1.4 KiB
TypeScript

'use client'
import NextLink from 'next/link'
import React from 'react'
export interface LinkProps {
href: string
children: React.ReactNode
variant?: 'primary' | 'secondary' | 'neutral'
external?: boolean
className?: string
onClick?: () => void
}
const variantStyles = {
primary: 'text-primary-600 hover:text-primary-700 dark:text-primary-400 dark:hover:text-primary-300',
secondary: 'text-secondary-600 hover:text-secondary-700 dark:text-secondary-400 dark:hover:text-secondary-300',
neutral: 'text-gray-700 hover:text-gray-900 dark:text-gray-300 dark:hover:text-gray-100',
}
export const Link = ({
href,
children,
variant = 'primary',
external = false,
className = '',
onClick,
}: LinkProps) => {
const baseStyles = 'underline decoration-1 underline-offset-2 hover:decoration-2 transition-all focus:outline-none focus-visible:ring-2 focus-visible:ring-primary-500 focus-visible:ring-offset-2 rounded-sm'
const combinedClassName = `${baseStyles} ${variantStyles[variant]} ${className}`.trim()
if (external) {
return (
<a
href={href}
className={combinedClassName}
target="_blank"
rel="noopener noreferrer"
onClick={onClick}
>
{children}
</a>
)
}
return (
<NextLink href={href} className={combinedClassName} onClick={onClick}>
{children}
</NextLink>
)
}