import * as React from 'react'; import Link from 'next/link'; import { cn } from '@/lib/utils'; import { motion } from 'motion/react'; import { Button } from '@/components/ui/button'; import { Book, Check, Copy, Terminal } from 'lucide-react'; import { useTranslations } from 'next-intl'; export interface DeveloperSectionProps { className?: string; } export const DeveloperSection = React.memo(function DeveloperSection({ className, }: DeveloperSectionProps) { const [copied, setCopied] = React.useState(false); const t = useTranslations('home.developerSection'); const codeContent = `# ${t('codeComment')} curl -X POST https://api.example.com/api/v1/auth/register \\ -H "Content-Type: application/json" \\ -d '{ "username": "developer", "email": "dev@example.com", "password": "secure_password" }'`; const onCopy = async () => { try { await navigator.clipboard.writeText(codeContent); setCopied(true); setTimeout(() => setCopied(false), 2000); } catch { const textArea = document.createElement('textarea'); textArea.value = codeContent; textArea.style.position = 'fixed'; textArea.style.left = '-9999px'; document.body.appendChild(textArea); textArea.select(); document.execCommand('copy'); document.body.removeChild(textArea); setCopied(true); setTimeout(() => setCopied(false), 2000); } }; return (
bash
                
                  
                    # {t('codeQuickStart')}
                  
                  {'\n'}
                  curl -X{' '}
                  POST{' '}
                  
                    https://api.example.com/api/v1/auth/register
                  {' '}
                  \{'\n'}
                  {'  '}-H{' '}
                  
                    "Content-Type: application/json"
                  {' '}
                  \{'\n'}
                  {'  '}-d{' '}
                  
                    "username=dev&password=***"
                  
                
              

{t('heading')}

{t('description')}

    {[ t('features.restful'), t('features.swagger'), t('features.typescript'), t('features.examples'), ].map((item, i) => (
  • {item}
  • ))}
); });