'use client'; import { useState } from 'react'; const PARCHMENT = '#F5EDD6'; const BROWN = '#4A2810'; const SAGE = '#5A8A4A'; const AMBER = '#C8781A'; const RED = '#C8442B'; export default function ApplyPage() { const [form, setForm] = useState({ name: '', email: '', profile: '', background: '', why: '', }); const [status, setStatus] = useState<'idle' | 'loading' | 'success' | 'error'>('idle'); const [message, setMessage] = useState(''); const handleChange = (e: React.ChangeEvent) => { setForm((prev) => ({ ...prev, [e.target.name]: e.target.value })); }; const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); if (!form.name || !form.email || !form.background || !form.why) { setStatus('error'); setMessage('Please fill in all required fields.'); return; } if (!form.email.includes('@')) { setStatus('error'); setMessage('Please enter a valid email address.'); return; } setStatus('loading'); try { const res = await fetch('https://api.skillfarm.ai/api/partner', { method: 'POST', headers: { 'Content-Type': 'application/json' }, body: JSON.stringify({ ...form, source: 'website' }), }); const data = await res.json(); if (data?.success) { setStatus('success'); setMessage("Application received. Sprout will be in touch. ๐ŸŒพ"); } else { setStatus('error'); setMessage(data?.message || 'Something went wrong. Please try again.'); } } catch { setStatus('error'); setMessage('Connection error. Please try again.'); } }; const pageStyle: React.CSSProperties = { backgroundImage: "url('/textures/skillfarm-bg-hero.png')", backgroundSize: 'cover', backgroundAttachment: 'fixed', backgroundPosition: 'center', backgroundColor: PARCHMENT, fontFamily: 'var(--font-crimson), Georgia, serif', }; const inputStyle: React.CSSProperties = { fontFamily: 'var(--font-crimson), Georgia, serif', backgroundColor: 'rgba(245,237,214,0.80)', color: BROWN, }; return (
{/* Warm parchment wash */}
{/* Logo */} {/* Header */}

Co-founder Application

{status !== 'success' && (

You found the application. That's already a good sign.

Tell us who you are, what you've built, what broke, and what you fixed. There's no template here โ€” just write like a person. Sprout reads every one. ๐ŸŒฑ

)}
{/* Form */} {status === 'success' ? (

๐ŸŒพ

Application received.

{message}

) : (
{/* Name */}
{/* Email */}
{/* LinkedIn / GitHub */}
{/* Background */}