refactor(medications): rename PascalCase component files to kebab-case

Bring the medication card, scheduling, wizard, and detail component
files in line with the kebab-case file-naming convention. Component
export identifiers are unchanged; only filenames and the import paths
that point at them move.
This commit is contained in:
Marc-André Bombeck committed 2026-06-19 22:17:13 +02:00
1 parent 7c2762b0a5
commit 922f770b41
48 files changed
+51 -51

No files matched your search

+1 -1
View File
@@ -26,7 +26,7 @@ import { Card } from "@/components/ui/card";
import {
MedicationDetailTabs,
type MedicationDetailSnapshot,
} from "@/components/medications/detail/MedicationDetailTabs";
} from "@/components/medications/detail/medication-detail-tabs";
import { apiGet } from "@/lib/api/api-fetch";
export default function MedicationDetailPage({
@@ -27,7 +27,7 @@ vi.mock("@/hooks/use-auth", () => ({
// The create wizard and the dialogs are closed in every assertion here;
// mock them away so the page render stays scoped to the list surface.
vi.mock("@/components/medications/wizard/MedicationWizardDialog", () => ({
vi.mock("@/components/medications/wizard/medication-wizard-dialog", () => ({
MedicationWizardDialog: () => null,
}));
vi.mock("@/components/medications/log-intake-dialog", () => ({
+1 -1
View File
@@ -7,7 +7,7 @@ import { useRouter, useSearchParams } from "next/navigation";
import { useAuth } from "@/hooks/use-auth";
import { useTranslations } from "@/lib/i18n/context";
import { queryKeys } from "@/lib/query-keys";
import { MedicationWizardDialog } from "@/components/medications/wizard/MedicationWizardDialog";
import { MedicationWizardDialog } from "@/components/medications/wizard/medication-wizard-dialog";
import { MedicationCard } from "@/components/medications/medication-card";
import { Glp1MedicationCard } from "@/components/medications/glp1-medication-card";
import { LogIntakeDialog } from "@/components/medications/log-intake-dialog";
@@ -72,7 +72,7 @@ import { ResponsiveSheet } from "@/components/ui/responsive-sheet";
import { Skeleton } from "@/components/ui/skeleton";
import { MeasurementForm } from "@/components/measurements/measurement-form";
import { VorsorgeTrendStrip } from "@/components/measurement-reminders/vorsorge-trend-strip";
import { MedicationCardHeader } from "@/components/medications/MedicationCardHeader";
import { MedicationCardHeader } from "@/components/medications/medication-card-header";
import {
useMeasurementReminders,
useMeasurementReminderMutations,
@@ -84,7 +84,7 @@ import {
DrugLevelChart,
parseDoseMg,
resolveDoseMg,
} from "../DrugLevelChart";
} from "../drug-level-chart";
function render(node: React.ReactNode, locale: "en" | "de" = "en") {
return renderToStaticMarkup(
@@ -3,7 +3,7 @@ import { renderToStaticMarkup } from "react-dom/server";
import { Badge } from "@/components/ui/badge";
import { Card } from "@/components/ui/card";
import { MedicationCardHeader } from "@/components/medications/MedicationCardHeader";
import { MedicationCardHeader } from "@/components/medications/medication-card-header";
/**
* v1.4.28 — narrow-viewport contract for the shared medication-list
@@ -94,7 +94,7 @@ vi.mock("@/components/ui/responsive-sheet", () => ({
) : null,
}));
import { ResearchModeAcknowledgmentDialog } from "../ResearchModeAcknowledgmentDialog";
import { ResearchModeAcknowledgmentDialog } from "../research-mode-acknowledgment-dialog";
function render(node: React.ReactNode, locale: "en" | "de" = "en") {
return renderToStaticMarkup(
@@ -3,7 +3,7 @@ import { renderToStaticMarkup } from "react-dom/server";
import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
import { I18nProvider } from "@/lib/i18n/context";
import { SideEffectsSection } from "@/components/medications/SideEffectsSection";
import { SideEffectsSection } from "@/components/medications/side-effects-section";
/**
* v1.4.25 W19d — SideEffectsSection SSR smoke tests.
@@ -6,7 +6,7 @@ import { AlertTriangle } from "lucide-react";
import { Card, CardContent } from "@/components/ui/card";
import { cn } from "@/lib/utils";
import { formatTimeWindowRange } from "@/lib/time-window-format";
import { MedicationCardHeader } from "@/components/medications/MedicationCardHeader";
import { MedicationCardHeader } from "@/components/medications/medication-card-header";
import { MedicationStatusPill } from "@/components/medications/card-parts/medication-status-pill";
import {
MedicationComplianceBars,
@@ -49,7 +49,7 @@ import { MedicationDetailSummary } from "@/components/medications/medication-det
import { MedicationDetailSection } from "@/components/medications/medication-detail-section";
import { MedicationComplianceBars } from "@/components/medications/card-parts/medication-compliance-bars";
import { DoseHistoryLedger } from "@/components/medications/dose-history-ledger";
import { ScheduleTimesEditor } from "@/components/medications/scheduling/ScheduleTimesEditor";
import { ScheduleTimesEditor } from "@/components/medications/scheduling/schedule-times-editor";
import { ScheduleHistoryTimeline } from "@/components/medications/scheduling/schedule-history-timeline";
import type { DoseWindowEntry } from "@/components/medications/scheduling/dose-window";
import { IntakeImportDialog } from "@/components/medications/intake-import-dialog";
@@ -68,12 +68,12 @@ import {
} from "@/components/medications/sections/destructive-zone-section";
import { SettingsGroup } from "@/components/medications/settings-group";
import { PhaseConfigSheet } from "@/components/medications/sections/phase-config-sheet";
import { SideEffectsSection } from "@/components/medications/SideEffectsSection";
import { SideEffectsSection } from "@/components/medications/side-effects-section";
import { ChartSkeleton } from "@/components/charts/chart-skeleton";
import { TitrationTimeline } from "@/components/medications/titration-timeline";
import { estimateRunwayDays } from "@/components/medications/detail/supply-runway";
import { summariseSupply } from "@/lib/medications/inventory/summary";
import { MedicationWizardDialog } from "@/components/medications/wizard/MedicationWizardDialog";
import { MedicationWizardDialog } from "@/components/medications/wizard/medication-wizard-dialog";
import { parseScheduleRecurrence } from "@/lib/medication-schedule";
import { useQuery } from "@tanstack/react-query";
import { queryKeys } from "@/lib/query-keys";
@@ -88,7 +88,7 @@ import type { ComplianceDisplay } from "@/lib/analytics/compliance";
// shared chart skeleton standing in while the chunk streams.
const DrugLevelChart = dynamic(
() =>
import("@/components/medications/DrugLevelChart").then((mod) => ({
import("@/components/medications/drug-level-chart").then((mod) => ({
default: mod.DrugLevelChart,
})),
{ ssr: false, loading: () => <ChartSkeleton /> },
@@ -6,7 +6,7 @@ import { I18nProvider } from "@/lib/i18n/context";
import {
CadencePicker,
encodeCadence,
} from "@/components/medications/scheduling/CadencePicker";
} from "@/components/medications/scheduling/cadence-picker";
import {
type CadenceKind,
type CadenceSubControls,
@@ -8,7 +8,7 @@ import {
dateToIsoString,
isRangeValid,
isoStringToDate,
} from "@/components/medications/scheduling/CourseWindowRow";
} from "@/components/medications/scheduling/course-window-row";
/**
* v1.5.0 — CourseWindowRow tests.
@@ -9,7 +9,7 @@ import {
removeTime,
sortTimes,
togglePreset,
} from "@/components/medications/scheduling/TimesOfDayChips";
} from "@/components/medications/scheduling/times-of-day-chips";
/**
* v1.5.0 — TimesOfDayChips tests.
@@ -12,7 +12,7 @@
* Pure functions only — no React, no DOM — so the unit tests can pin
* the mapping table without spinning up a render tree.
*/
import { encodeCadence } from "./CadencePicker";
import { encodeCadence } from "./cadence-picker";
import {
type CadenceSubControls,
type CadenceValue,
@@ -61,7 +61,7 @@ import {
} from "@/components/ui/dialog";
import { DateInput } from "@/components/ui/date-input";
import { Label } from "@/components/ui/label";
import { TimesOfDayChips } from "@/components/medications/scheduling/TimesOfDayChips";
import { TimesOfDayChips } from "@/components/medications/scheduling/times-of-day-chips";
import { apiDelete, apiGet, apiPatch, apiPost } from "@/lib/api/api-fetch";
import { useFormatters, useTranslations } from "@/lib/i18n/context";
import { queryKeys } from "@/lib/query-keys";
@@ -23,8 +23,8 @@ import { toast } from "sonner";
import { Button } from "@/components/ui/button";
import { Label } from "@/components/ui/label";
import { TimesOfDayChips } from "@/components/medications/scheduling/TimesOfDayChips";
import { DoseWindowEditor } from "@/components/medications/scheduling/DoseWindowEditor";
import { TimesOfDayChips } from "@/components/medications/scheduling/times-of-day-chips";
import { DoseWindowEditor } from "@/components/medications/scheduling/dose-window-editor";
import {
type DoseWindowEntry,
type DoseWindowScale,
@@ -20,7 +20,7 @@ import {
WIZARD_TREATMENT_MAPPING,
type WizardTreatmentRow,
} from "@/components/medications/wizard/wizard-payload";
import { encodeCadence } from "@/components/medications/scheduling/CadencePicker";
import { encodeCadence } from "@/components/medications/scheduling/cadence-picker";
import {
type CadenceKind,
DEFAULT_SUB_CONTROLS,
@@ -49,7 +49,7 @@ import { ResponsiveSheet } from "@/components/ui/responsive-sheet";
import { useTranslations } from "@/lib/i18n/context";
import { invalidateKeys, medicationDependentKeys } from "@/lib/query-keys";
import { NaturalLanguageExtractor } from "@/components/medications/scheduling/NaturalLanguageExtractor";
import { NaturalLanguageExtractor } from "@/components/medications/scheduling/natural-language-extractor";
import {
addSchedule,
@@ -65,15 +65,15 @@ import {
setActiveSchedule,
type WizardPayload,
} from "./wizard-payload";
import { WizardStepper } from "./WizardStepper";
import { Step1Name } from "./steps/Step1Name";
import { Step2Class } from "./steps/Step2Class";
import { Step3Dose } from "./steps/Step3Dose";
import { Step4Window } from "./steps/Step4Window";
import { Step5Cadence } from "./steps/Step5Cadence";
import { Step6SubCadence } from "./steps/Step6SubCadence";
import { Step7Times } from "./steps/Step7Times";
import { Step8Summary } from "./steps/Step8Summary";
import { WizardStepper } from "./wizard-stepper";
import { Step1Name } from "./steps/step1-name";
import { Step2Class } from "./steps/step2-class";
import { Step3Dose } from "./steps/step3-dose";
import { Step4Window } from "./steps/step4-window";
import { Step5Cadence } from "./steps/step5-cadence";
import { Step6SubCadence } from "./steps/step6-sub-cadence";
import { Step7Times } from "./steps/step7-times";
import { Step8Summary } from "./steps/step8-summary";
import { validateStep } from "./wizard-payload";
import { extractorToWizardPartial } from "./nl-bridge";
@@ -11,14 +11,14 @@
* the mapping logic.
*/
import { encodeCadence } from "@/components/medications/scheduling/CadencePicker";
import { isoStringToDate } from "@/components/medications/scheduling/CourseWindowRow";
import { encodeCadence } from "@/components/medications/scheduling/cadence-picker";
import { isoStringToDate } from "@/components/medications/scheduling/course-window-row";
import {
DEFAULT_SUB_CONTROLS,
type CadenceSubControls,
type WeekdayToken,
} from "@/components/medications/scheduling/types";
import type { WizardPayload as ExtractorPayload } from "@/components/medications/scheduling/NaturalLanguageExtractor";
import type { WizardPayload as ExtractorPayload } from "@/components/medications/scheduling/natural-language-extractor";
import type { WizardPayload } from "./wizard-payload";
@@ -22,7 +22,7 @@ import {
type WizardTreatmentRow,
WIZARD_TREATMENT_ROWS,
} from "../wizard-payload";
import type { StepProps } from "./Step1Name";
import type { StepProps } from "./step1-name";
// Each row's Lucide glyph. maintainer-confirmed assignment in D-1 §3 Step 2.
const ROW_ICONS: Record<
@@ -24,7 +24,7 @@ import type { MedicationDeliveryForm } from "@/lib/validations/medication";
import { unitsPerDoseOptionsFor } from "@/components/medications/units-per-dose";
import { useTranslations } from "@/lib/i18n/context";
import type { StepProps } from "./Step1Name";
import type { StepProps } from "./step1-name";
/**
* Dose unit choices, ordered so mg / ml / IE / µg lead and the
@@ -1,8 +1,8 @@
"use client";
import { CourseWindowRow } from "@/components/medications/scheduling/CourseWindowRow";
import { CourseWindowRow } from "@/components/medications/scheduling/course-window-row";
import type { StepProps } from "./Step1Name";
import type { StepProps } from "./step1-name";
/**
* Step 4 — Behandlungszeitraum (course window).
@@ -1,11 +1,11 @@
"use client";
import { encodeCadence } from "@/components/medications/scheduling/CadencePicker";
import { encodeCadence } from "@/components/medications/scheduling/cadence-picker";
import type { CadenceKind } from "@/components/medications/scheduling/types";
import { useTranslations } from "@/lib/i18n/context";
import type { WizardPayload } from "../wizard-payload";
import type { StepProps } from "./Step1Name";
import type { StepProps } from "./step1-name";
/**
* The seven cadence rows surfaced in Step 5. Each maps to a (mode,
@@ -2,7 +2,7 @@
import { useMemo } from "react";
import { encodeCadence } from "@/components/medications/scheduling/CadencePicker";
import { encodeCadence } from "@/components/medications/scheduling/cadence-picker";
import { Input } from "@/components/ui/input";
import { Label } from "@/components/ui/label";
import {
@@ -12,7 +12,7 @@ import {
} from "@/components/medications/scheduling/types";
import { useTranslations } from "@/lib/i18n/context";
import type { StepProps } from "./Step1Name";
import type { StepProps } from "./step1-name";
/**
* Step 6 — sub-cadence detail. The body swaps on the cadence kind the
@@ -2,12 +2,12 @@
import { Moon, Sun, Sunrise, Sunset } from "lucide-react";
import { TimesOfDayChips } from "@/components/medications/scheduling/TimesOfDayChips";
import { DoseWindowEditor } from "@/components/medications/scheduling/DoseWindowEditor";
import { TimesOfDayChips } from "@/components/medications/scheduling/times-of-day-chips";
import { DoseWindowEditor } from "@/components/medications/scheduling/dose-window-editor";
import type { DoseWindowScale } from "@/components/medications/scheduling/dose-window";
import { useTranslations } from "@/lib/i18n/context";
import type { StepProps } from "./Step1Name";
import type { StepProps } from "./step1-name";
/**
* Step 7 — Einnahmezeit(en). Reuses the v1.5 `TimesOfDayChips`
@@ -43,11 +43,11 @@
* reads. The mapping table is the single source of truth.
*/
import { encodeCadence } from "@/components/medications/scheduling/CadencePicker";
import { encodeCadence } from "@/components/medications/scheduling/cadence-picker";
import {
dateToIsoString,
isoStringToDate,
} from "@/components/medications/scheduling/CourseWindowRow";
} from "@/components/medications/scheduling/course-window-row";
import {
type CadenceKind,
type CadenceSubControls,
@@ -29,7 +29,7 @@ vi.mock("@tanstack/react-query", () => ({
useMutation: () => ({ mutate: vi.fn(), isPending: false }),
}));
vi.mock("@/components/medications/ResearchModeAcknowledgmentDialog", () => ({
vi.mock("@/components/medications/research-mode-acknowledgment-dialog", () => ({
ResearchModeAcknowledgmentDialog: () => <div data-slot="mock-ack-dialog" />,
}));
@@ -16,7 +16,7 @@
* even when `enabled === true`.
*
* The dialog itself is covered by
* `ResearchModeAcknowledgmentDialog.test.tsx`; we mock it down to a
* `research-mode-acknowledgment-dialog.test.tsx`; we mock it down to a
* marker here so the toggle behaviour is the only contract under
* test.
*/
@@ -48,7 +48,7 @@ vi.mock("@tanstack/react-query", () => ({
// import to a transparent marker so we can assert "the toggle ON path
// renders the dialog with the right props" without re-running the
// dialog tree.
vi.mock("@/components/medications/ResearchModeAcknowledgmentDialog", () => ({
vi.mock("@/components/medications/research-mode-acknowledgment-dialog", () => ({
ResearchModeAcknowledgmentDialog: ({
open,
currentDisclaimerVersion,
+1 -1
View File
@@ -17,7 +17,7 @@ import {
} from "@/components/ui/alert-dialog";
import { Button } from "@/components/ui/button";
import { Switch } from "@/components/ui/switch";
import { ResearchModeAcknowledgmentDialog } from "@/components/medications/ResearchModeAcknowledgmentDialog";
import { ResearchModeAcknowledgmentDialog } from "@/components/medications/research-mode-acknowledgment-dialog";
import { formatDateTime } from "@/lib/format";
import { SettingsCard } from "@/components/settings/settings-card";
import { SettingsCardHeader } from "@/components/settings/_card-header";