import React, { Suspense } from 'react';
import type { Metadata } from 'next';
import Link from 'next/link';
import SignupClientPage from './ClientPage';

export const metadata: Metadata = {
  title: {
    absolute: 'Create Free Account | QR Master'
  },
  description: 'Sign up for QR Master to create free QR codes. Start with tracking, customization, and bulk generation features.',
  alternates: {
    canonical: 'https://www.qrmaster.net/signup',
  },
  openGraph: {
    title: 'Create Free Account | QR Master',
    description: 'Sign up for QR Master to create free QR codes with tracking and customization.',
    url: 'https://www.qrmaster.net/signup',
    type: 'website',
    images: [{
      url: 'https://www.qrmaster.net/og-image.png',
      width: 1200,
      height: 630,
      alt: 'QR Master Sign Up',
    }],
  },
  twitter: {
    card: 'summary_large_image',
    title: 'Create Free Account | QR Master',
    description: 'Sign up for QR Master to create free QR codes with tracking and customization.',
    images: ['https://www.qrmaster.net/og-image.png'],
  },
};



export default function SignupPage() {
  return (
    <div className="min-h-screen bg-gradient-to-br from-primary-50 to-white flex items-center justify-center p-4">
      <div className="w-full max-w-md">
        <div className="text-center mb-8">
          <Link href="/" className="inline-flex items-center space-x-2 mb-6">
            <img src="/logo.svg" alt="QR Master" className="w-10 h-10" />
            <span className="text-2xl font-bold text-gray-900">QR Master</span>
          </Link>
          <h1 className="text-3xl font-bold text-gray-900">Create Account</h1>
          <p className="text-gray-600 mt-2">Start creating QR codes in seconds</p>
          <Link href="/" className="text-sm text-primary-600 hover:text-primary-700 font-medium mt-2 inline-block border border-primary-600 hover:border-primary-700 px-4 py-2 rounded-lg transition-colors">
            ← Back to Home
          </Link>
        </div>

        <Suspense fallback={
          <div className="bg-white rounded-xl shadow-sm border border-slate-200 p-8 flex items-center justify-center min-h-[500px]">
            <div className="animate-spin rounded-full h-8 w-8 border-b-2 border-primary-600"></div>
          </div>
        }>
          <SignupClientPage />
        </Suspense>

        <p className="text-center text-sm text-gray-500 mt-6">
          By signing up, you agree to our{' '}
          <Link href="/privacy" className="text-primary-600 hover:text-primary-700">
            Privacy Policy
          </Link>
        </p>
      </div>
    </div>
  );
}