"use client"; import { useState } from "react"; import { Card, CardHeader, CardTitle, CardContent, CardDescription } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import Link from "next/link"; import { ArrowRight, Plus } from "lucide-react"; import { useTranslations } from "next-intl"; interface Organization { id: string; name: string; } interface OrganizationLandingProps { organizations?: Organization[]; disableCreateOrg?: boolean; } export default function OrganizationLanding({ organizations = [], disableCreateOrg = false }: OrganizationLandingProps) { const [selectedOrg, setSelectedOrg] = useState(null); const handleOrgClick = (orgId: string) => { setSelectedOrg(orgId); }; const t = useTranslations(); function getDescriptionText() { if (organizations.length === 0) { if (!disableCreateOrg) { return t('componentsErrorNoMemberCreate'); } else { return t('componentsErrorNoMember'); } } return t('componentsMember', {count: organizations.length}); } return ( {t('welcome')} {getDescriptionText()} {organizations.length === 0 ? ( disableCreateOrg ? (

t('componentsErrorNoMember')

) : ( ) ) : (
    {organizations.map((org) => (
  • ))}
)}
); }