import clsx from "clsx"; import { TbArrowRight, TbCircle, TbCircleCheckFilled, TbFingerprint } from "react-icons/tb"; import { useApiQuery } from "bknd/client"; import { useBknd } from "ui/client/bknd"; import { useBkndAuth } from "ui/client/schema/auth/use-bknd-auth"; import { ButtonLink, type ButtonLinkProps } from "ui/components/buttons/Button"; import { IconButton } from "ui/components/buttons/IconButton"; import { Alert } from "ui/components/display/Alert"; import * as AppShell from "ui/layouts/AppShell/AppShell"; import { routes, useNavigate } from "ui/lib/routes"; export function AuthIndex() { const { app } = useBknd(); const { config: { roles, strategies, entity_name, enabled }, } = useBkndAuth(); const users_entity = entity_name; const $q = useApiQuery((api) => api.data.count(users_entity), { enabled, }); const usersTotal = $q.data?.count ?? 0; const rolesTotal = Object.keys(roles ?? {}).length ?? 0; const strategiesTotal = Object.keys(strategies ?? {}).length ?? 0; const usersLink = app.getAbsolutePath("/data/" + routes.data.entity.list(users_entity)); const rolesLink = routes.auth.roles.list(); const strategiesLink = routes.auth.strategies(); return ( <> Overview
Getting started
0} to={rolesLink} /> 0} to={usersLink} /> 1} to={strategiesLink} />
); } type KpiCardProps = { title: string; value: number; actions: (Omit & { label: string; href?: string })[]; }; const KpiCard: React.FC = ({ title, value, actions }) => (
{title} {/*+6.1%*/}
{value}
{actions.map((action, i) => ( {action.label} ))}
); const Item = ({ title, done = false, to }: { title: string; done?: boolean; to?: string }) => { const [navigate] = useNavigate(); return (
{done ? : }

{title}

{to && navigate(to)} />}
); };