mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-10 13:22:14 +00:00
style: apply prettier across the tree
One-shot prettier pass so the new format:check gate starts from a clean baseline. Formatting only — no behaviour change. Generator-owned and vendored artifacts stay untouched via .prettierignore.
This commit is contained in:
1 parent
b3fea2ef59
commit
1f4ba5939d
1000 files changed
+12130
-8385
No files matched your search
@@ -16,10 +16,7 @@ import { Skeleton } from "@/components/ui/skeleton";
|
||||
import { useTranslations } from "@/lib/i18n/context";
|
||||
|
||||
import { useIllnessCorrelation } from "./use-illness";
|
||||
import type {
|
||||
IllnessCorrelationValue,
|
||||
IllnessVitalDeviation,
|
||||
} from "./types";
|
||||
import type { IllnessCorrelationValue, IllnessVitalDeviation } from "./types";
|
||||
|
||||
/** Translate a MeasurementType to its illness-surface label. */
|
||||
function useVitalLabel() {
|
||||
@@ -76,7 +73,9 @@ function CorrelationBody({ value }: { value: IllnessCorrelationValue }) {
|
||||
{gap > 0
|
||||
? t("illness.correlation.recoveryGapLag", { days: gap })
|
||||
: gap < 0
|
||||
? t("illness.correlation.recoveryGapLead", { days: Math.abs(gap) })
|
||||
? t("illness.correlation.recoveryGapLead", {
|
||||
days: Math.abs(gap),
|
||||
})
|
||||
: t("illness.correlation.recoveryGapSame")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
@@ -32,8 +32,8 @@ function DayLogRow({ log }: { log: IllnessDayLogDTO }) {
|
||||
const fmt = useFormatters();
|
||||
|
||||
return (
|
||||
<div className="space-y-2 border-border/60 border-l-2 pl-3">
|
||||
<p className="text-muted-foreground text-xs font-medium uppercase tracking-wide">
|
||||
<div className="border-border/60 space-y-2 border-l-2 pl-3">
|
||||
<p className="text-muted-foreground text-xs font-medium tracking-wide uppercase">
|
||||
{fmt.dateShort(`${log.date}T12:00:00`)}
|
||||
</p>
|
||||
|
||||
|
||||
@@ -86,7 +86,10 @@ export function IllnessEpisodeDetail({ episodeId }: { episodeId: string }) {
|
||||
) : null}
|
||||
</div>
|
||||
<div className="flex shrink-0 items-center gap-1">
|
||||
<Button onClick={() => setLogOpen(true)} className="min-h-11 sm:min-h-9">
|
||||
<Button
|
||||
onClick={() => setLogOpen(true)}
|
||||
className="min-h-11 sm:min-h-9"
|
||||
>
|
||||
{t("illness.logDay")}
|
||||
</Button>
|
||||
{episode ? (
|
||||
@@ -94,7 +97,9 @@ export function IllnessEpisodeDetail({ episodeId }: { episodeId: string }) {
|
||||
episode={episode}
|
||||
onEdit={() => setEditOpen(true)}
|
||||
onResolve={
|
||||
active && !isChronic ? () => resolve.mutate(episode.id) : undefined
|
||||
active && !isChronic
|
||||
? () => resolve.mutate(episode.id)
|
||||
: undefined
|
||||
}
|
||||
resolving={resolve.isPending}
|
||||
/>
|
||||
@@ -105,7 +110,7 @@ export function IllnessEpisodeDetail({ episodeId }: { episodeId: string }) {
|
||||
{episode?.note ? (
|
||||
<Card>
|
||||
<CardContent className="pt-6">
|
||||
<p className="text-muted-foreground text-xs font-medium uppercase tracking-wide">
|
||||
<p className="text-muted-foreground text-xs font-medium tracking-wide uppercase">
|
||||
{t("illness.detail.note")}
|
||||
</p>
|
||||
<p className="text-foreground mt-1 text-sm whitespace-pre-wrap">
|
||||
|
||||
@@ -14,7 +14,11 @@ import { useTranslations } from "@/lib/i18n/context";
|
||||
|
||||
import { useIllnessInsights } from "./use-illness";
|
||||
|
||||
export function IllnessInsightsCard({ windowDays = 365 }: { windowDays?: number }) {
|
||||
export function IllnessInsightsCard({
|
||||
windowDays = 365,
|
||||
}: {
|
||||
windowDays?: number;
|
||||
}) {
|
||||
const { t } = useTranslations();
|
||||
const { data, isLoading, isError } = useIllnessInsights(windowDays);
|
||||
|
||||
@@ -47,7 +51,9 @@ export function IllnessInsightsCard({ windowDays = 365 }: { windowDays?: number
|
||||
<p className="text-foreground">
|
||||
{data.episodeCount === 1
|
||||
? t("illness.insights.countOne")
|
||||
: t("illness.insights.countOther", { count: data.episodeCount })}
|
||||
: t("illness.insights.countOther", {
|
||||
count: data.episodeCount,
|
||||
})}
|
||||
</p>
|
||||
<p className="text-muted-foreground">
|
||||
{data.typicalRecoveryGapDays !== null
|
||||
|
||||
@@ -277,7 +277,7 @@ function EpisodeGroup({
|
||||
onClick={() => setOpen((v) => !v)}
|
||||
aria-expanded={open}
|
||||
aria-controls={gridId}
|
||||
className="text-muted-foreground hover:text-foreground -mx-1 flex w-fit items-center gap-1.5 rounded-md px-1 py-0.5 text-xs font-medium uppercase tracking-wide transition-colors"
|
||||
className="text-muted-foreground hover:text-foreground -mx-1 flex w-fit items-center gap-1.5 rounded-md px-1 py-0.5 text-xs font-medium tracking-wide uppercase transition-colors"
|
||||
>
|
||||
<ChevronDown
|
||||
className={cn(
|
||||
@@ -298,7 +298,7 @@ function EpisodeGroup({
|
||||
|
||||
return (
|
||||
<section className="space-y-3">
|
||||
<h2 className="text-muted-foreground text-xs font-medium uppercase tracking-wide">
|
||||
<h2 className="text-muted-foreground text-xs font-medium tracking-wide uppercase">
|
||||
{title}
|
||||
</h2>
|
||||
{grid}
|
||||
@@ -314,7 +314,9 @@ export function IllnessView() {
|
||||
|
||||
const today = todayLocal();
|
||||
const [newOpen, setNewOpen] = useState(false);
|
||||
const [editEpisode, setEditEpisode] = useState<IllnessEpisodeDTO | null>(null);
|
||||
const [editEpisode, setEditEpisode] = useState<IllnessEpisodeDTO | null>(
|
||||
null,
|
||||
);
|
||||
const [logEpisodeId, setLogEpisodeId] = useState<string | null>(null);
|
||||
|
||||
const logEpisode = episodes?.find((e) => e.id === logEpisodeId) ?? null;
|
||||
|
||||
@@ -17,10 +17,7 @@ import { useMemo, useState } from "react";
|
||||
import { Activity, CalendarDays, NotebookPen, Thermometer } from "lucide-react";
|
||||
|
||||
import { ResponsiveSheet } from "@/components/ui/responsive-sheet";
|
||||
import {
|
||||
SheetSection,
|
||||
SheetSectionCount,
|
||||
} from "@/components/ui/sheet-section";
|
||||
import { SheetSection, SheetSectionCount } from "@/components/ui/sheet-section";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Label } from "@/components/ui/label";
|
||||
@@ -259,7 +256,9 @@ export function LogDaySheet({
|
||||
title={t("illness.sheet.day")}
|
||||
icon={<CalendarDays className="h-4 w-4" />}
|
||||
summary={
|
||||
<span className="text-muted-foreground text-xs">{selectedDate}</span>
|
||||
<span className="text-muted-foreground text-xs">
|
||||
{selectedDate}
|
||||
</span>
|
||||
}
|
||||
defaultOpen
|
||||
>
|
||||
@@ -319,9 +318,7 @@ export function LogDaySheet({
|
||||
key={value}
|
||||
active={functionalImpact === value}
|
||||
onClick={() =>
|
||||
setFunctionalImpact(
|
||||
functionalImpact === value ? null : value,
|
||||
)
|
||||
setFunctionalImpact(functionalImpact === value ? null : value)
|
||||
}
|
||||
>
|
||||
{impactLabels[value]}
|
||||
|
||||
@@ -22,12 +22,12 @@ import {
|
||||
} from "@/components/ui/select";
|
||||
import { useTranslations } from "@/lib/i18n/context";
|
||||
|
||||
import { useCreateEpisode, useIllnessEpisodes, useUpdateEpisode } from "./use-illness";
|
||||
import type {
|
||||
IllnessEpisodeDTO,
|
||||
IllnessLifecycle,
|
||||
IllnessType,
|
||||
} from "./types";
|
||||
import {
|
||||
useCreateEpisode,
|
||||
useIllnessEpisodes,
|
||||
useUpdateEpisode,
|
||||
} from "./use-illness";
|
||||
import type { IllnessEpisodeDTO, IllnessLifecycle, IllnessType } from "./types";
|
||||
|
||||
const TYPES: IllnessType[] = [
|
||||
"INFECTION",
|
||||
@@ -151,7 +151,10 @@ export function NewEpisodeSheet({
|
||||
<Button variant="ghost" onClick={() => onOpenChange(false)}>
|
||||
{t("common.cancel")}
|
||||
</Button>
|
||||
<Button onClick={handleSave} disabled={pending || label.trim() === ""}>
|
||||
<Button
|
||||
onClick={handleSave}
|
||||
disabled={pending || label.trim() === ""}
|
||||
>
|
||||
{t("common.save")}
|
||||
</Button>
|
||||
</>
|
||||
@@ -212,7 +215,9 @@ export function NewEpisodeSheet({
|
||||
<SelectValue placeholder={t("illness.new.parentNone")} />
|
||||
</SelectTrigger>
|
||||
<SelectContent>
|
||||
<SelectItem value={NONE}>{t("illness.new.parentNone")}</SelectItem>
|
||||
<SelectItem value={NONE}>
|
||||
{t("illness.new.parentNone")}
|
||||
</SelectItem>
|
||||
{parentCandidates.map((e) => (
|
||||
<SelectItem key={e.id} value={e.id}>
|
||||
{e.label}
|
||||
|
||||
@@ -122,8 +122,13 @@ export function useCreateEpisode() {
|
||||
export function useUpdateEpisode() {
|
||||
const invalidate = useInvalidateIllness();
|
||||
return useMutation({
|
||||
mutationFn: ({ id, input }: { id: string; input: IllnessEpisodeUpdateInput }) =>
|
||||
apiPatch<IllnessEpisodeDTO>(`/api/illness/episodes/${id}`, input),
|
||||
mutationFn: ({
|
||||
id,
|
||||
input,
|
||||
}: {
|
||||
id: string;
|
||||
input: IllnessEpisodeUpdateInput;
|
||||
}) => apiPatch<IllnessEpisodeDTO>(`/api/illness/episodes/${id}`, input),
|
||||
onSuccess: invalidate,
|
||||
});
|
||||
}
|
||||
@@ -142,8 +147,7 @@ export function useResolveEpisode() {
|
||||
export function useDeleteEpisode() {
|
||||
const invalidate = useInvalidateIllness();
|
||||
return useMutation({
|
||||
mutationFn: (id: string) =>
|
||||
apiDelete<void>(`/api/illness/episodes/${id}`),
|
||||
mutationFn: (id: string) => apiDelete<void>(`/api/illness/episodes/${id}`),
|
||||
onSuccess: invalidate,
|
||||
});
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user