import { useApiQuery } from "ui/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 { Alert } from "ui/components/display/Alert"; import * as AppShell from "ui/layouts/AppShell/AppShell"; import { routes } 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 = app.getSettingsPath(["auth", "strategies"]); return ( <> Overview
); } 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} ))}
);