import Link from "next/link"; import { getMyInvitesResponseSchema } from "@turbostarter/api/schema"; import { handle } from "@turbostarter/api/utils"; import { Badge } from "@turbostarter/ui-web/badge"; import { pathsConfig } from "~/config/paths"; import { api } from "~/lib/api/server"; import { getMetadata } from "~/lib/metadata"; import { DashboardHeader, DashboardHeaderDescription, DashboardHeaderTitle, } from "~/modules/common/layout/dashboard/header"; export const generateMetadata = getMetadata({ title: "Invites", description: "Invites you've issued.", }); export default async function InvitesPage() { const { sent } = await handle(api.my.invites.$get, { schema: getMyInvitesResponseSchema, })(); return ( <>
Invites Invite links you've issued across all your meshes.
{sent.length === 0 ? (

You haven't issued any invites yet. Open a mesh and generate one.

) : (
{sent.map((inv) => ( ))}
Mesh Role Uses Expires Status
{inv.meshId ? ( {inv.meshName ?? "—"} {inv.meshSlug ?? "—"} ) : ( )} {inv.role} {inv.usedCount} / {inv.maxUses} {new Date(inv.expiresAt).toLocaleDateString()} {inv.revokedAt ? ( revoked ) : new Date(inv.expiresAt) < new Date() ? ( expired ) : inv.usedCount >= inv.maxUses ? ( exhausted ) : ( active )}
)} ); }