'use client' import { useState, useEffect } from 'react' import Link from 'next/link' import Header from '@/components/Header' import Footer from '@/components/Footer' import { useLanguage } from '@/lib/LanguageContext' interface FundingApplication { id: string application_number: string title: string funding_program: string status: string current_step: number total_steps: number requested_amount: number school_profile?: { name: string federal_state: string } created_at: string updated_at: string } interface Statistics { total_applications: number draft_count: number submitted_count: number approved_count: number total_requested: number total_approved: number } export default function FoerderantragPage() { const { t, isRTL } = useLanguage() const [applications, setApplications] = useState([]) const [statistics, setStatistics] = useState(null) const [loading, setLoading] = useState(true) useEffect(() => { setApplications([]) setStatistics({ total_applications: 0, draft_count: 0, submitted_count: 0, approved_count: 0, total_requested: 0, total_approved: 0, }) setLoading(false) }, []) const formatCurrency = (amount: number) => { return new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR', }).format(amount) } return ( <>
{/* Hero Section */}

{t('fa_title')}

{t('fa_subtitle')}

{t('fa_new_application')}
{/* Statistics Cards */}
{statistics?.total_applications || 0}
{t('fa_statistics')}
{formatCurrency(statistics?.total_requested || 0)}
{t('fa_program_dp2')}
{/* Quick Start Cards */}

{t('fa_preset_basic_name')}

{t('fa_preset_basic_desc')}

{t('fa_preset_basic_budget')}

{t('fa_preset_cluster_name')}

{t('fa_preset_cluster_desc')}

{t('fa_preset_cluster_budget')}

{t('fa_preset_custom_name')}

{t('fa_preset_custom_desc')}

{t('fa_preset_custom_budget')}
{/* Applications List */}
{loading ? (
) : applications.length === 0 ? (

{t('fa_no_applications')}

{t('fa_start_first')}

{t('fa_new_application')}
) : (
{applications.map((app) => (

{app.title}

{app.application_number}
{formatCurrency(app.requested_amount)}
))}
)}
{/* Info Box */}

{t('fa_info_title')}

{t('fa_info_text')}