Loading...
import { useState, useEffect, useCallback } from "react"; import { useParams, useNavigate } from "react-router"; import { Masthead } from "../components/Masthead"; import { DirectiveList } from "../components/directives/DirectiveList"; import { DirectiveDetail } from "../components/directives/DirectiveDetail"; import { useDirectives, useDirective } from "../hooks/useDirectives"; import { useDogs } from "../hooks/useDogs"; import { useUserSettings } from "../hooks/useUserSettings"; import { useAuth } from "../contexts/AuthContext"; import DocumentDirectivesPage from "./document-directives"; import { getRepositorySuggestions, startDirective, pauseDirective, updateDirective, type RepositoryHistoryEntry, type DirectiveSummary } from "../lib/api"; /** * Top-level /directives route. Gates between the legacy tabular UI and the * Document Mode (POC) UI based on the user's settings flag. * * Both code paths support /directives/:id deep links — the param is read by * each branch independently via useParams. */ export default function DirectivesPage() { const { settings, loading: settingsLoading } = useUserSettings(); // While settings are loading for the very first time, render nothing inside // a Masthead-wrapped shell so we don't briefly flash the legacy UI just to // swap to document mode a moment later. if (settingsLoading && !settings) { return (
Loading...
Loading...
{listLoading ? "Loading..." : "Select a directive or create a new one"}