import { useState } from 'react'
import { useMutation } from '@tanstack/react-query'
import { KeyRound, LogOut, ShieldCheck } from 'lucide-react'
import { Link } from 'react-router-dom'
import { authApi } from '../lib/auth'
import { useAuth } from '../lib/useAuth'
import { CAP, can } from '../lib/can'
import { TimeZonePanel } from './TimeZonePanel'
import { Badge, Panel } from '../components/ui'
export function Settings() {
const { principal, logout } = useAuth()
return (
{/* Account management lives on ONE screen. Settings used to carry its own Team panel: a second
user list on a different query key, whose invite sent no tool set and so created accounts
entitled to nothing, and whose role changes did not invalidate the other screen. Two surfaces
for the same thing disagreed about what access a person had, which is the worst possible thing
for an access control screen to be ambiguous about. */}
{can(principal, CAP.userInvite) && (
Create accounts, set roles, and choose which tools each person can see.
Open accounts and access
)}
{/* Owner only: the server refuses it for anyone else, so offering it would be a button that fails. */}
{can(principal, CAP.orgSettings) && }
Federated SSO (Login.gov, Entra Gov, PIV CAC) and public signup are a later sub phase. Invites are
delivered manually at pilot, the link is shown after you invite a teammate.