"use client"; import { useEffect, useState } from "react"; import Link from "next/link"; import { c2api } from "@/lib/c2api"; import { useNodes } from "@/lib/useNodes"; import { getCurrentSubscription, getPlan, type Subscription } from "@/lib/billing"; import { Card, CardHeader } from "@/components/ui/Card"; import { Badge } from "@/components/ui/Badge"; import { Button } from "@/components/ui/Button"; import { Skeleton } from "@/components/ui/Skeleton"; function StatTile({ label, value }: { label: string; value: string | number }) { return (

{label}

{value}

); } export default function OrganizationSettingsPage() { const { nodes } = useNodes(); const [memberCount, setMemberCount] = useState(null); const [sub, setSub] = useState(null); const [orgName, setOrgName] = useState("My Organization"); useEffect(() => { c2api.listUsers().then((u) => setMemberCount(u.length)).catch(() => setMemberCount(null)); getCurrentSubscription().then(setSub); }, []); const plan = sub ? getPlan(sub.planId) : null; return (
setOrgName(e.target.value)} className="w-full bg-gray-800 border border-gray-700 rounded-lg px-3 py-2 text-white text-sm focus:outline-none focus:border-indigo-500" />
Preview only — no backend endpoint stores this yet.
{plan.name} plan ) : ( ) } />
Manage plan & billing → Manage members →
); }