Signal/signal-ui/src/ThemeProvider.jsx
Kisa a424ac9d13 feat: add reason strings per patient, fix export headers, add signal-ui source
- Add _build_reason() to backend — per-patient reason strings with specific
  day counts (e.g. "Supply lapsed 70 days ago. Prescriber contact required.")
- Add reason field to RecordOut model and backend /api/export CSV
- Fix export column headers: Coverage End Date → Resupply End Date,
  Days Until Coverage End → Days Until Resupply End
- Pass reason through apiRecordToLocal in frontend api.js
- Display reason as muted sub-line under status badge in WorklistTable
- Add reason column to client-side CSVExport
- Add signal-ui React source to repo (was untracked)
- CLAUDE.md: add Billing and CMS integrations to Phase 2 deferred table
- research: restore Section 14 stat verification (May 23 recovery)

Deployed to Railway production — health check confirmed live.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-26 09:45:02 -04:00

27 lines
No EOL
731 B
JavaScript

import { useState, useEffect, useCallback } from "react";
import { ThemeContext } from "./ThemeContext";
export function ThemeProvider({ children }) {
const [dark, setDark] = useState(() => {
const stored = localStorage.getItem("signal-theme");
if (stored) return stored === "dark";
return true;
});
useEffect(() => {
if (dark) {
document.documentElement.classList.add("dark");
} else {
document.documentElement.classList.remove("dark");
}
localStorage.setItem("signal-theme", dark ? "dark" : "light");
}, [dark]);
const toggle = useCallback(() => setDark((prev) => !prev), []);
return (
<ThemeContext value={{ dark, toggle }}>
{children}
</ThemeContext>
);
}