'use client' import React, { useState, useEffect } from 'react' import { ControlListView } from '../control-library/components/ControlListView' import { useControlLibraryState } from '../control-library/components/useControlLibraryState' /** * Master Controls page — reuses the Control Library UI exactly, * but shows Master Controls (13.5K grouped controls) instead of * individual atomic controls (272K). * * The MC API route (/api/sdk/v1/master-controls) returns data in * the same format as the canonical controls endpoint. */ export default function MasterControlsPage() { // Reuse the exact same state hook — it fetches from BACKEND_URL // We override BACKEND_URL via a wrapper, but for now we reuse as-is // since both endpoints speak the same format. const state = useControlLibraryState('/api/sdk/v1/master-controls') if (state.loading && state.controls.length === 0) { return (
{state.error}
{mcId} — {totalControls} Atomic Controls
{/* Phase badges */}{m.title}
{m.regulation_source && ({m.regulation_source} {m.regulation_article}
)} > ) return m.control_id ? ( {inner} ) : (