"use client"; import { Key } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { SettingsCard } from "@/components/settings/settings-card"; import { SettingsCardHeader } from "@/components/settings/_card-header"; import { useTranslations } from "@/lib/i18n/context"; /** The ingest endpoints a token reaches, with the header and a body sketch. */ export function ApiEndpointsCard() { const { t } = useTranslations(); // Dual-render: `. The endpoint catalogue is array-driven // so adding a row remains a one-line edit on both surfaces — which is // what the two measurement ingest rows below cost. const endpoints = [ { method: "POST", path: "/api/ingest/medication", auth: "Authorization: Bearer hlk_...", example: `{ "medicationName": "...", "scheduledFor": "..." }`, }, { method: "POST", path: "/api/measurements", auth: "Authorization: Bearer hlk_...", example: `{ "type": "WEIGHT", "value": 82.4, "measuredAt": "..." }`, }, { method: "POST", path: "/api/measurements/batch", auth: "Authorization: Bearer hlk_...", example: `{ "entries": [ { "hkIdentifier": "...", "value": 1, ... } ] }`, }, { method: "POST", path: "/api/workouts/batch", auth: "Authorization: Bearer hlk_...", example: `{ "workouts": [ { "sportType": "running", "startedAt": "...", "endedAt": "...", "externalId": "..." } ] }`, }, { method: "POST", path: "/api/documents/inbound", auth: "Authorization: Bearer hlk_...", example: `multipart: file, title, documentDate, sourceSystem, sourceId`, }, ]; return ( {/* Desktop table — verbatim layout for md+. */}
{endpoints.map((endpoint) => ( ))}
{t("settings.apiEndpointMethod")} {t("settings.apiEndpointPath")} {t("settings.apiEndpointAuth")} {t("settings.apiEndpointExample")}
{endpoint.method} {endpoint.path} {endpoint.auth} {endpoint.example}
{/* Mobile card list — each endpoint stacks its columns vertically with a labelled meta row. No horizontal scroll. */}
    {endpoints.map((endpoint) => (
  • {endpoint.method} {endpoint.path}

    {t("settings.apiEndpointAuth")}

    {endpoint.auth}

    {t("settings.apiEndpointExample")}

    {endpoint.example}
  • ))}
); }