mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 05:12:14 +00:00
refactor(medications): import the shared ComplianceDisplay type on the cards
The generic and GLP-1 medication cards each re-spelled the `ComplianceDisplay` interface already exported from the compliance lib. Drop both hand-copies and import the canonical type so a future field change lands in one place.
This commit is contained in:
1 parent
068cb168d9
commit
a357332a32
2 files changed
+2
-20
No files matched your search
@@ -29,6 +29,7 @@ import {
|
||||
reduceCurrentWindowStatus,
|
||||
toBerlinDate,
|
||||
} from "@/lib/medications/window-status";
|
||||
import type { ComplianceDisplay } from "@/lib/analytics/compliance";
|
||||
|
||||
/**
|
||||
* v1.4.25 W4d — GLP-1 medication card variant.
|
||||
@@ -99,16 +100,6 @@ export interface Glp1Medication {
|
||||
schedules: ScheduleLite[];
|
||||
}
|
||||
|
||||
interface ComplianceDisplay {
|
||||
shortDays: number;
|
||||
longDays: number;
|
||||
expectedShort: number;
|
||||
expectedLong: number;
|
||||
minStableDoses: number;
|
||||
short: { rate: number; streak: number };
|
||||
long: { rate: number };
|
||||
}
|
||||
|
||||
interface ComplianceData {
|
||||
compliance7: { rate: number; streak: number };
|
||||
compliance30: { rate: number };
|
||||
|
||||
@@ -26,6 +26,7 @@ import {
|
||||
import { LogInjectionSiteDialog } from "@/components/medications/log-injection-site-dialog";
|
||||
import { useGlobalExcludedInjectionSites } from "@/lib/medications/use-injection-site-prefs";
|
||||
import type { InjectionSiteKey } from "@/lib/medications/injection-sites";
|
||||
import type { ComplianceDisplay } from "@/lib/analytics/compliance";
|
||||
|
||||
interface Schedule {
|
||||
id: string;
|
||||
@@ -71,16 +72,6 @@ interface Medication {
|
||||
schedules: Schedule[];
|
||||
}
|
||||
|
||||
interface ComplianceDisplay {
|
||||
shortDays: number;
|
||||
longDays: number;
|
||||
expectedShort: number;
|
||||
expectedLong: number;
|
||||
minStableDoses: number;
|
||||
short: { rate: number; streak: number };
|
||||
long: { rate: number };
|
||||
}
|
||||
|
||||
interface ComplianceData {
|
||||
compliance7: {
|
||||
totalExpected: number;
|
||||
|
||||
Reference in new issue
Block a user