import type { Metadata } from "next"; import Link from "next/link"; import { Label as MuLabel } from "@unlocalhosted/metalui"; import { leaveOrgAction } from "@/app/actions/orgs"; import { ActionButton } from "@/components/action-button"; import { GearIcon, OrganizationIcon, PlusIcon } from "@/components/icons"; import { SettingsSection } from "@/components/metal"; import { OrgInvitations } from "@/components/org-invitations"; import { ListRow } from "@/components/settings-plate"; import { Avatar, Blankslate, ButtonLink, Label, PageTitle } from "@/components/ui"; import { requireViewer } from "@/lib/auth"; import { timeAgo } from "@/lib/format"; import { listInvitationsFor, listOrgsOf, ROLE_INFO } from "@/lib/orgs"; export const metadata: Metadata = { title: "Organizations" }; export default async function OrganizationsSettingsPage() { const viewer = await requireViewer("/settings/organizations"); const [memberships, invitations] = await Promise.all([listOrgsOf(viewer.id), listInvitationsFor(viewer.id)]); return (