This commit is contained in:
@@ -317,6 +317,8 @@ export type DateSpanParams = z.infer<typeof DateSpanParams>
|
||||
export const CorrelationInputPayload = z.discriminatedUnion("kind", [
|
||||
z.object({ kind: z.literal("metric"), metric: MetricKind }),
|
||||
z.object({ kind: z.literal("moonPhase") }),
|
||||
z.object({ kind: z.literal("cycleProgress") }),
|
||||
z.object({ kind: z.literal("temperature") }),
|
||||
z.object({
|
||||
kind: z.literal("activity"),
|
||||
activityId: uuid,
|
||||
|
||||
@@ -28,7 +28,10 @@ export function MetricRow({
|
||||
return (
|
||||
<div className="flex flex-col gap-1.5">
|
||||
<Label htmlFor={inputId} className="flex items-center gap-2 text-xs">
|
||||
<Icon className="h-3.5 w-3.5 text-muted-foreground" aria-hidden="true" />
|
||||
<Icon
|
||||
className="h-3.5 w-3.5 text-muted-foreground"
|
||||
aria-hidden="true"
|
||||
/>
|
||||
{field.label}
|
||||
<span className="text-muted-foreground">({field.unit})</span>
|
||||
</Label>
|
||||
|
||||
@@ -21,6 +21,10 @@ function labelOf(row: CorrelationRowResponse): string {
|
||||
}
|
||||
case "moonPhase":
|
||||
return "Moon phase"
|
||||
case "cycleProgress":
|
||||
return "Cycle progress"
|
||||
case "temperature":
|
||||
return "Temperature"
|
||||
case "activity":
|
||||
return input.name
|
||||
}
|
||||
@@ -34,8 +38,12 @@ function orderOf(row: CorrelationRowResponse): number {
|
||||
return METRIC_FIELDS.findIndex((f) => f.kind === input.metric)
|
||||
case "moonPhase":
|
||||
return METRIC_FIELDS.length
|
||||
case "activity":
|
||||
case "cycleProgress":
|
||||
return METRIC_FIELDS.length + 1
|
||||
case "temperature":
|
||||
return METRIC_FIELDS.length + 2
|
||||
case "activity":
|
||||
return METRIC_FIELDS.length + 3
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +92,10 @@ function rowKey(row: CorrelationRowResponse): string {
|
||||
return `metric:${input.metric}`
|
||||
case "moonPhase":
|
||||
return "moonPhase"
|
||||
case "cycleProgress":
|
||||
return "cycleProgress"
|
||||
case "temperature":
|
||||
return "temperature"
|
||||
case "activity":
|
||||
return `activity:${input.activityId}`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user