mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-16 23:33:29 +00:00
Move the preventive-care surface from the German-derived slug /vorsorge to the English /checkups and make the feature read consistently across locales. The route directory, the nav entry, the dashboard card link, and the onboarding tour step now point at /checkups. A permanent redirect keeps old bookmarks, the PWA's cached navigation, and push deep-links resolving. Display label is now "Checkups" in English and the equivalent term in Spanish (Revisiones), French (Examens), Italian (Controlli), and Polish (Badania); German keeps "Vorsorge". The internal id stays "vorsorge" so saved layouts, module-order preferences, and tour state keep resolving without a data migration.
52 lines
1.7 KiB
TypeScript
52 lines
1.7 KiB
TypeScript
"use client";
|
|
|
|
import { useCallback } from "react";
|
|
import { Loader2 } from "lucide-react";
|
|
import { useQueryClient } from "@tanstack/react-query";
|
|
|
|
import { useAuth } from "@/hooks/use-auth";
|
|
import { useMounted } from "@/hooks/use-mounted";
|
|
import { usePullToRefresh } from "@/hooks/use-pull-to-refresh";
|
|
import { PullToRefreshIndicator } from "@/components/ui/pull-to-refresh-indicator";
|
|
import { VorsorgeSection } from "@/components/measurement-reminders/vorsorge-section";
|
|
import { queryKeys } from "@/lib/query-keys";
|
|
|
|
/**
|
|
* v1.17.1 — Checkups (preventive-care) reminders page. The dedicated
|
|
* feature surface for "wann muss ich was wo machen". Auth-gated; the
|
|
* section component owns the list + create flow.
|
|
*
|
|
* v1.18.1 — pull-to-refresh parity with every peer page (labs, mood,
|
|
* measurements): a pull invalidates the measurement-reminders read so the
|
|
* list + server-computed next-due repaint.
|
|
*/
|
|
export default function CheckupsPage() {
|
|
const { isAuthenticated, isLoading } = useAuth();
|
|
const mounted = useMounted();
|
|
const queryClient = useQueryClient();
|
|
|
|
const refresh = useCallback(
|
|
() =>
|
|
queryClient.invalidateQueries({
|
|
queryKey: queryKeys.measurementReminders(),
|
|
}),
|
|
[queryClient],
|
|
);
|
|
const pull = usePullToRefresh({ onRefresh: refresh });
|
|
|
|
if (!mounted || isLoading) {
|
|
return (
|
|
<div className="flex min-h-[40vh] items-center justify-center">
|
|
<Loader2 className="text-muted-foreground h-6 w-6 animate-spin motion-reduce:animate-none" />
|
|
</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<div className="space-y-6">
|
|
<PullToRefreshIndicator {...pull} />
|
|
<VorsorgeSection enabled={isAuthenticated} variant="page" />
|
|
</div>
|
|
);
|
|
}
|