import AppLogoIcon from '@/components/app-logo-icon';
import { Button } from '@/components/ui/button';
import { Head, Link } from '@inertiajs/react';
import { Inbox, MessageCircle, ShieldCheck, Users } from 'lucide-react';

const features = [
    { icon: Inbox, title: 'One inbox', text: 'Email and chat land in one shared queue for your whole team.' },
    { icon: MessageCircle, title: 'Realtime', text: 'New messages and ticket changes show up instantly for every agent.' },
    { icon: Users, title: 'Roles and groups', text: 'Owners, admins, agents and light agents, each with the right access.' },
    { icon: ShieldCheck, title: 'Your data stays yours', text: 'Every company is isolated. No one else can ever see your tickets.' },
];

export default function Welcome() {
    return (
        <>
            <Head title="Customer support for growing teams" />
            <div className="bg-background text-foreground min-h-svh">
                <header className="mx-auto flex max-w-6xl items-center justify-between px-6 py-5">
                    <Link href="/" className="flex items-center gap-2 font-semibold">
                        <AppLogoIcon className="size-7 fill-current" /> Tawkzo
                    </Link>
                    <nav className="flex items-center gap-2">
                        <Button variant="ghost" asChild>
                            <Link href={route('workspace.find')}>Log in</Link>
                        </Button>
                        <Button asChild>
                            <Link href={route('signup')}>Start free trial</Link>
                        </Button>
                    </nav>
                </header>

                <main className="mx-auto max-w-6xl px-6">
                    <section className="py-20 text-center md:py-28">
                        <h1 className="mx-auto max-w-3xl text-4xl font-semibold tracking-tight text-balance md:text-5xl">
                            Answer every customer from one inbox
                        </h1>
                        <p className="text-muted-foreground mx-auto mt-5 max-w-xl text-lg text-pretty">
                            An affordable helpdesk for small and mid-sized teams. Set up in minutes, free for 14 days.
                        </p>
                        <div className="mt-8 flex justify-center gap-3">
                            <Button size="lg" asChild>
                                <Link href={route('signup')}>Create your workspace</Link>
                            </Button>
                        </div>
                    </section>

                    <section className="grid gap-6 pb-24 sm:grid-cols-2 lg:grid-cols-4">
                        {features.map(({ icon: Icon, title, text }) => (
                            <div key={title} className="rounded-lg border p-5">
                                <Icon className="text-primary size-5" />
                                <h2 className="mt-3 font-medium">{title}</h2>
                                <p className="text-muted-foreground mt-1 text-sm">{text}</p>
                            </div>
                        ))}
                    </section>
                </main>
            </div>
        </>
    );
}
