2 Commits

11 changed files with 86 additions and 254 deletions

View File

@@ -17,6 +17,5 @@ export { getApi } from "./src/hooks/useApi";
export { useItemSse } from "./src/hooks/useItemSse"; export { useItemSse } from "./src/hooks/useItemSse";
export { sanitizePayload } from "./src/utils/sanitize-payload"; export { sanitizePayload } from "./src/utils/sanitize-payload";
export type { FkResolver } from "./src/utils/sanitize-payload"; export type { FkResolver } from "./src/utils/sanitize-payload";
export { formatDate, formatDateTime } from "./src/utils/datetime";
export type { FilterComponentProps } from "./src/context/useResource"; export type { FilterComponentProps } from "./src/context/useResource";
export type { SpecConfiguration, ResourceConfig, FieldConfig, FKFieldConfig, ResourceRelationship, ProfileOperation, ProfileComponents, AuthConfig } from "./src/types"; export type { SpecConfiguration, ResourceConfig, FieldConfig, FKFieldConfig, ResourceRelationship, ProfileOperation, ProfileComponents, AuthConfig } from "./src/types";

View File

@@ -3,7 +3,6 @@ import { useNavigate } from "react-router-dom";
import { Box, Typography, Chip, Avatar, Dialog, DialogTitle, DialogContent, DialogActions, Button, Grid } from "@mui/material"; import { Box, Typography, Chip, Avatar, Dialog, DialogTitle, DialogContent, DialogActions, Button, Grid } from "@mui/material";
import type { FieldConfig } from "../../types"; import type { FieldConfig } from "../../types";
import { applyDisplayFormat, resolveMediaUrl } from "./utils"; import { applyDisplayFormat, resolveMediaUrl } from "./utils";
import { formatByFieldFormat } from "../../utils/datetime";
import { InlineRefField } from "./renderers/InlineRefField"; import { InlineRefField } from "./renderers/InlineRefField";
import { CurrencyField } from "./renderers/CurrencyField"; import { CurrencyField } from "./renderers/CurrencyField";
import { extractFields } from "../../transformers/field-config"; import { extractFields } from "../../transformers/field-config";
@@ -58,7 +57,7 @@ export function ListCellRenderer({ field, value, displayFormat, basePath }: List
{sf.label} {sf.label}
</Typography> </Typography>
<Typography variant="body2"> <Typography variant="body2">
{fv == null ? "—" : typeof fv === "object" ? (sf.inlineDisplayFormat ? applyDisplayFormat(fv, sf.inlineDisplayFormat) : JSON.stringify(fv)) : formatByFieldFormat(fv, sf.format)} {fv == null ? "—" : typeof fv === "object" ? (sf.inlineDisplayFormat ? applyDisplayFormat(fv, sf.inlineDisplayFormat) : JSON.stringify(fv)) : String(fv)}
</Typography> </Typography>
</Box> </Box>
</Grid> </Grid>
@@ -154,5 +153,5 @@ export function ListCellRenderer({ field, value, displayFormat, basePath }: List
return <Typography variant="body2">{applyDisplayFormat(value, displayFormat ?? "")}</Typography>; return <Typography variant="body2">{applyDisplayFormat(value, displayFormat ?? "")}</Typography>;
} }
return <Typography variant="body2">{formatByFieldFormat(value, field.format)}</Typography>; return <Typography variant="body2">{String(value)}</Typography>;
} }

View File

@@ -10,26 +10,11 @@ interface Props {
} }
export function DateField({ field, value, onChange, error }: Props) { export function DateField({ field, value, onChange, error }: Props) {
// `x-edit-as: date` renders a date-time field as a plain date picker; const inputType = field.format === "date" ? "date" : "datetime-local";
// the picked day is submitted as midnight so the stored type is intact.
const editAsDate = field.format === "date" || field.editAs === "date";
const inputType = editAsDate ? "date" : "datetime-local"; const normalized = field.format === "date-time" && typeof value === "string"
? value.replace(/\.\d+Z$/, "").replace(/Z$/, "")
const normalized = (() => { : value;
if (field.format !== "date-time" || typeof value !== "string") return value;
if (editAsDate) return value.slice(0, 10);
return value.replace(/\.\d+Z$/, "").replace(/Z$/, "");
})();
const handleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
const v = e.target.value;
if (editAsDate && field.format === "date-time" && /^\d{4}-\d{2}-\d{2}$/.test(v)) {
onChange(`${v}T00:00:00`);
} else {
onChange(v);
}
};
return ( return (
<TextField <TextField
@@ -37,7 +22,7 @@ export function DateField({ field, value, onChange, error }: Props) {
label={field.label} label={field.label}
type={inputType} type={inputType}
value={normalized ?? ""} value={normalized ?? ""}
onChange={handleChange} onChange={(e) => onChange(e.target.value)}
error={!!error} error={!!error}
helperText={error || field.description || undefined} helperText={error || field.description || undefined}
placeholder={field.description || undefined} placeholder={field.description || undefined}

View File

@@ -2,7 +2,6 @@ import React, { useState } from "react";
import { Box, Typography, Chip, Dialog, DialogTitle, DialogContent, DialogActions, Button, Grid } from "@mui/material"; import { Box, Typography, Chip, Dialog, DialogTitle, DialogContent, DialogActions, Button, Grid } from "@mui/material";
import type { FieldConfig } from "../../../types"; import type { FieldConfig } from "../../../types";
import { applyDisplayFormat } from "../utils"; import { applyDisplayFormat } from "../utils";
import { formatByFieldFormat } from "../../../utils/datetime";
import { extractFields } from "../../../transformers/field-config"; import { extractFields } from "../../../transformers/field-config";
import { useAppContext } from "../../../context/AppContext"; import { useAppContext } from "../../../context/AppContext";
@@ -69,7 +68,7 @@ export function InlineRefField({ field, value }: Props) {
<Typography variant="caption" color="text.secondary" fontWeight={600} sx={{ mb: 0.25, display: "block" }}> <Typography variant="caption" color="text.secondary" fontWeight={600} sx={{ mb: 0.25, display: "block" }}>
{sf.label} {sf.label}
</Typography> </Typography>
<Typography variant="body2">{value?.[sf.name] == null ? "—" : typeof value[sf.name] === "object" ? (sf.inlineDisplayFormat ? applyDisplayFormat(value[sf.name], sf.inlineDisplayFormat) : JSON.stringify(value[sf.name])) : formatByFieldFormat(value[sf.name], sf.format)}</Typography> <Typography variant="body2">{value?.[sf.name] == null ? "—" : typeof value[sf.name] === "object" ? (sf.inlineDisplayFormat ? applyDisplayFormat(value[sf.name], sf.inlineDisplayFormat) : JSON.stringify(value[sf.name])) : String(value[sf.name])}</Typography>
</Box> </Box>
</Grid> </Grid>
))} ))}

View File

@@ -1,5 +1,3 @@
import { formatIsoLike } from "../../utils/datetime";
function getNested(obj: any, path: string): any { function getNested(obj: any, path: string): any {
return path.split(".").reduce((o, k) => o?.[k], obj); return path.split(".").reduce((o, k) => o?.[k], obj);
} }
@@ -8,7 +6,7 @@ export function applyDisplayFormat(item: any, format: string): string {
if (!item || typeof item !== "object") return String(item ?? ""); if (!item || typeof item !== "object") return String(item ?? "");
return format.replace(/\{([\w.]+)\}/g, (_, key) => { return format.replace(/\{([\w.]+)\}/g, (_, key) => {
const val = getNested(item, key); const val = getNested(item, key);
return val != null ? formatIsoLike(val) : ""; return val != null ? String(val) : "";
}); });
} }

View File

@@ -64,7 +64,6 @@ function extractOneOfOptions(schema: any, schemas: Record<string, any>, discrimi
description: prop["x-description"] ?? "", description: prop["x-description"] ?? "",
type: prop.type ?? "string", type: prop.type ?? "string",
format: prop.format, format: prop.format,
editAs: prop["x-edit-as"],
order: prop["x-order"] ?? Infinity, order: prop["x-order"] ?? Infinity,
hidden: prop["x-hidden"] ?? {}, hidden: prop["x-hidden"] ?? {},
filterable: prop["x-filterable"] ?? false, filterable: prop["x-filterable"] ?? false,
@@ -131,7 +130,6 @@ export function extractFields(schemaName: string, schema: any, schemas: Record<s
description: prop["x-description"] ?? "", description: prop["x-description"] ?? "",
type: isRef && refSchema ? "object" : isOneOf ? "object" : (prop.type ?? "string"), type: isRef && refSchema ? "object" : isOneOf ? "object" : (prop.type ?? "string"),
format: prop.format, format: prop.format,
editAs: prop["x-edit-as"],
order: prop["x-order"] ?? Infinity, order: prop["x-order"] ?? Infinity,
hidden: prop["x-hidden"] ?? {}, hidden: prop["x-hidden"] ?? {},
filterable: prop["x-filterable"] ?? false, filterable: prop["x-filterable"] ?? false,

View File

@@ -101,8 +101,6 @@ export interface FieldConfig {
description: string; description: string;
type: string; type: string;
format?: string; format?: string;
/** `x-edit-as: date` — edit a `date-time` field with a plain date input; submits midnight. */
editAs?: string;
order: number; order: number;
hidden: { form?: boolean; list?: boolean; detail?: boolean }; hidden: { form?: boolean; list?: boolean; detail?: boolean };
filterable: boolean; filterable: boolean;

View File

@@ -1,63 +0,0 @@
/**
* Zero-dependency date/time display helpers.
*
* Only ISO-shaped strings ("2026-08-24", "2026-08-24T09:07:25[.f][Z]") are
* reformatted; anything else (DD-MM-YYYY expense strings, free text) passes
* through untouched. Naive strings without a zone are parsed as clock time
* so the displayed wall time matches what the backend stored.
*/
const ISO_DATE = /^\d{4}-\d{2}-\d{2}$/;
const ISO_DATETIME = /^\d{4}-\d{2}-\d{2}[T ]\d{2}:\d{2}/;
function parseIso(value: any): Date | null {
if (typeof value !== "string") return null;
if (!ISO_DATE.test(value) && !ISO_DATETIME.test(value)) return null;
const d = new Date(value);
return isNaN(d.getTime()) ? null : d;
}
const DATE_FMT = new Intl.DateTimeFormat("en-IN", { day: "numeric", month: "short", year: "numeric" });
const DATETIME_FMT = new Intl.DateTimeFormat("en-IN", {
day: "numeric",
month: "short",
year: "numeric",
hour: "2-digit",
minute: "2-digit",
hour12: false,
});
function fallback(value: any): string {
return typeof value === "string" ? value : value != null ? String(value) : "";
}
/** "2026-08-24" -> "24 Aug 2026"; non-ISO values pass through. */
export function formatDate(value: any): string {
const d = parseIso(value);
return d ? DATE_FMT.format(d) : fallback(value);
}
/** "2026-08-24T09:07:25" -> "24 Aug 2026, 09:07"; non-ISO values pass through. */
export function formatDateTime(value: any): string {
const d = parseIso(value);
return d ? DATETIME_FMT.format(d) : fallback(value);
}
/** Route by OpenAPI field format ("date" | "date-time"); other formats render plainly. */
export function formatByFieldFormat(value: any, format?: string): string {
if (format === "date") return formatDate(value);
if (format === "date-time") return formatDateTime(value);
return fallback(value);
}
/**
* Metadata-free variant for display-format templates ({key} interpolation):
* reformats a scalar only when it happens to be ISO-shaped.
*/
export function formatIsoLike(value: any): string {
if (typeof value === "string") {
if (ISO_DATETIME.test(value)) return formatDateTime(value);
if (ISO_DATE.test(value)) return formatDate(value);
}
return fallback(value);
}

View File

@@ -6,7 +6,6 @@ import {
import { useNavigate } from "react-router-dom"; import { useNavigate } from "react-router-dom";
import ReceiptLongIcon from "@mui/icons-material/ReceiptLong"; import ReceiptLongIcon from "@mui/icons-material/ReceiptLong";
import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline"; import DeleteOutlineIcon from "@mui/icons-material/DeleteOutline";
import { alpha } from "@mui/material/styles";
import { useAppContext, useResource, ListCellRenderer, FormFieldRenderer, getApi, applyDisplayFormat } from "../../react-openapi"; import { useAppContext, useResource, ListCellRenderer, FormFieldRenderer, getApi, applyDisplayFormat } from "../../react-openapi";
import type { FieldConfig } from "../../react-openapi"; import type { FieldConfig } from "../../react-openapi";
import { PageHeader } from "../ui/PageHeader"; import { PageHeader } from "../ui/PageHeader";
@@ -16,33 +15,6 @@ import { useToast } from "../ui/Toast";
const CREATE_FIELDS = ["account", "bank", "pipeline", "trust_fallback", "start_date", "end_date", "source"]; const CREATE_FIELDS = ["account", "bank", "pipeline", "trust_fallback", "start_date", "end_date", "source"];
// Two-pane form partition — explicit names, spec order is unreliable.
// Grid stretch keeps both panes equal-height regardless of which source
// variant is active (email adds From/Subject under the type select).
const SOURCE_PANE_FIELDS = ["account", "bank"];
const POLICY_PANE_FIELDS = ["start_date", "end_date", "pipeline", "trust_fallback"];
const glassSx = (theme: any) => ({
backgroundColor: alpha(theme.palette.background.default, 0.72),
backdropFilter: "blur(8px)",
borderColor: "divider",
boxShadow: 1,
});
function GlassPanel({ title, children }: { title: string; children: React.ReactNode }) {
return (
<Paper variant="outlined" sx={(theme) => ({ p: 3, borderRadius: 3, ...glassSx(theme) })}>
<Typography
variant="overline"
sx={{ display: "block", mb: 2, color: "text.secondary", letterSpacing: 1.2, lineHeight: 1.4 }}
>
{title}
</Typography>
<Box sx={{ display: "flex", flexDirection: "column", gap: 2 }}>{children}</Box>
</Paper>
);
}
function FetchRequestList() { function FetchRequestList() {
const navigate = useNavigate(); const navigate = useNavigate();
const { list, remove, resource } = useResource("fetch-requests"); const { list, remove, resource } = useResource("fetch-requests");
@@ -116,52 +88,31 @@ function FetchRequestList() {
<Paper <Paper
key={row.id ?? i} key={row.id ?? i}
variant="outlined" variant="outlined"
sx={(theme) => ({ sx={{
p: 2, p: 2,
cursor: "pointer", cursor: "pointer",
borderRadius: 3, borderRadius: 2,
transition: "border-color 160ms ease, box-shadow 160ms ease, background-color 160ms ease", transition: "border-color 160ms ease, box-shadow 160ms ease",
"&:hover": { "&:hover": { borderColor: "primary.main", boxShadow: 1 },
borderColor: "primary.main", }}
boxShadow: 1,
backgroundColor: alpha(theme.palette.background.default, 0.9),
},
...glassSx(theme),
})}
onClick={() => navigate(`/fetch-requests/${row.id}`)} onClick={() => navigate(`/fetch-requests/${row.id}`)}
> >
<Box sx={{ display: "flex", gap: 2, alignItems: "center" }}> <Box sx={{ display: "flex", gap: 2, flexWrap: "wrap", alignItems: "center" }}>
<Box sx={{ display: "flex", gap: 2, flexWrap: "wrap", alignItems: "center", flex: 1, minWidth: 0 }}> {columns.map((col) => (
{columns <Box key={col.name} sx={{ minWidth: 120 }}>
.filter((col) => col.name !== "created_at") <Typography variant="caption" color="text.secondary" sx={{ display: "block" }}>
.map((col) => ( {col.label}
<Box key={col.name} sx={{ minWidth: 120 }}> </Typography>
<Typography variant="caption" color="text.secondary" sx={{ display: "block" }}> <ListCellRenderer
{col.label} field={col}
</Typography> value={row[col.name]}
<ListCellRenderer displayFormat={col.fk
field={col} ? (allResources.find((r) => r.name === col.fk!.resource)?.displayFormat ?? displayFormat)
value={row[col.name]} : displayFormat}
displayFormat={col.fk />
? (allResources.find((r) => r.name === col.fk!.resource)?.displayFormat ?? displayFormat) </Box>
: displayFormat} ))}
/> <Box sx={{ ml: "auto", flexShrink: 0 }}>
</Box>
))}
</Box>
{(() => {
const dateCol = columns.find((col) => col.name === "created_at");
if (!dateCol) return null;
return (
<Box sx={{ flexShrink: 0, textAlign: "right" }}>
<Typography variant="caption" color="text.secondary" sx={{ display: "block" }}>
{dateCol.label}
</Typography>
<ListCellRenderer field={dateCol} value={row.created_at} displayFormat={displayFormat} />
</Box>
);
})()}
<Box sx={{ flexShrink: 0 }}>
<Tooltip title="Delete fetch request"> <Tooltip title="Delete fetch request">
<IconButton <IconButton
size="small" size="small"
@@ -256,90 +207,59 @@ export default function FetchRequestCreate() {
); );
} }
const renderPaneFields = (names: string[]) =>
names.map((name) => {
const field = formFields.find((f) => f.name === name);
if (!field) return null;
return (
<FormFieldRenderer
key={field.name}
field={field}
value={formData[field.name] ?? ""}
onChange={(val) => handleChange(field.name, val)}
fkOptions={fkOptions[field.name]}
/>
);
});
return ( return (
<Box sx={{ position: "relative" }}> <Container maxWidth="lg" sx={{ py: 4 }}>
{/* Decorative gradient backdrop — gives the frosted panes something to blur. */} <PageHeader
<Box crumbs={[{ label: "Home", path: "/" }, { label: "Fetch Requests" }]}
aria-hidden title="Fetch Requests"
sx={{ subtitle="Import transactions from bank statements or email and track pipeline progress."
position: "fixed",
inset: 0,
zIndex: 0,
pointerEvents: "none",
background: (theme) =>
[
`radial-gradient(640px circle at 12% 8%, ${alpha(theme.palette.primary.main, 0.14)}, transparent 70%)`,
`radial-gradient(900px circle at 88% 92%, ${alpha(theme.palette.primary.main, 0.09)}, transparent 70%)`,
`radial-gradient(520px circle at 78% 22%, ${alpha(theme.palette.primary.light, 0.07)}, transparent 70%)`,
].join(", "),
}}
/> />
<Container maxWidth="lg" sx={{ py: 4, position: "relative", zIndex: 1 }}>
<PageHeader
crumbs={[{ label: "Home", path: "/" }, { label: "Fetch Requests" }]}
title="Fetch Requests"
subtitle="Import transactions from bank statements or email and track pipeline progress."
/>
<Box id="new-fetch-request" sx={{ mb: 4 }}> <Paper
<Typography variant="subtitle1" fontWeight={700} gutterBottom> id="new-fetch-request"
New Fetch Request variant="outlined"
</Typography> sx={{ p: 3, mb: 4, borderRadius: 3 }}
<Typography variant="body2" color="text.secondary" sx={{ mb: 2.5, maxWidth: 560, lineHeight: 1.6 }}> >
Choose an account, pipeline, and a file or email source to kick off an import. <Typography variant="subtitle1" fontWeight={700} gutterBottom>
</Typography> New Fetch Request
</Typography>
<Typography variant="body2" color="text.secondary" sx={{ mb: 3, maxWidth: 520, lineHeight: 1.6 }}>
Choose an account, pipeline, and a file or email source to kick off an import.
</Typography>
<Box <Box sx={{ display: "flex", flexDirection: "column", gap: 2, maxWidth: 520 }}>
sx={{ {formFields.map((field) => (
display: "grid", <FormFieldRenderer
gridTemplateColumns: { xs: "1fr", md: "1fr 1fr" }, key={field.name}
gap: 2, field={field}
}} value={formData[field.name] ?? ""}
> onChange={(val) => handleChange(field.name, val)}
<GlassPanel title="Source & Account"> fkOptions={fkOptions[field.name]}
{renderPaneFields(SOURCE_PANE_FIELDS)} />
{renderPaneFields(["source"])} ))}
</GlassPanel>
<GlassPanel title="Window & Policy">{renderPaneFields(POLICY_PANE_FIELDS)}</GlassPanel>
</Box>
<Box sx={{ display: "flex", justifyContent: "flex-end", mt: 3, gap: 1.5 }}>
<Button variant="outlined" onClick={() => { setFormData({}); setResult(null); }}>
Reset
</Button>
<Button variant="contained" onClick={handleSubmit} disabled={loading} sx={{ minWidth: 180 }}>
{loading ? <CircularProgress size={20} sx={{ mr: 0.5 }} /> : null}
Create Fetch Request
</Button>
</Box>
{result && (
<Alert severity={result.severity} sx={{ mt: 2 }} onClose={() => setResult(null)}>
{result.message}
</Alert>
)}
</Box> </Box>
<Typography variant="h6" fontWeight={700} sx={{ mb: 2 }}> <Box sx={{ display: "flex", justifyContent: "flex-end", mt: 3, gap: 1.5 }}>
Recent Fetch Requests <Button variant="outlined" onClick={() => { setFormData({}); setResult(null); }}>
</Typography> Reset
<FetchRequestList /> </Button>
</Container> <Button variant="contained" onClick={handleSubmit} disabled={loading} sx={{ minWidth: 180 }}>
</Box> {loading ? <CircularProgress size={20} sx={{ mr: 0.5 }} /> : null}
Create Fetch Request
</Button>
</Box>
{result && (
<Alert severity={result.severity} sx={{ mt: 2 }} onClose={() => setResult(null)}>
{result.message}
</Alert>
)}
</Paper>
<Typography variant="h6" fontWeight={700} sx={{ mb: 2 }}>
Recent Fetch Requests
</Typography>
<FetchRequestList />
</Container>
); );
} }

View File

@@ -51,7 +51,7 @@ export function ReportList({ reports, loading, fields, selectedId, onView, onReg
"&:hover": { borderColor: "primary.light" }, "&:hover": { borderColor: "primary.light" },
}} }}
> >
<Box sx={{ display: "flex", alignItems: "center", gap: 2 }}> <Box sx={{ display: "flex", alignItems: "center", gap: 2, flexWrap: "wrap" }}>
<Box sx={{ flex: "1 1 260px", minWidth: 0 }}> <Box sx={{ flex: "1 1 260px", minWidth: 0 }}>
<Typography variant="body1" fontWeight={600} noWrap sx={{ fontSize: "0.9375rem" }}> <Typography variant="body1" fontWeight={600} noWrap sx={{ fontSize: "0.9375rem" }}>
{report.name || report.id} {report.name || report.id}
@@ -81,15 +81,14 @@ export function ReportList({ reports, loading, fields, selectedId, onView, onReg
{amounts} {amounts}
</Typography> </Typography>
)} )}
{fields && (
<Box sx={{ color: "text.secondary" }}>
<ListCellRenderer field={fields.generatedAt} value={report.generated_at} />
</Box>
)}
</Box> </Box>
</Box> </Box>
{fields && (
<Box sx={{ ml: "auto", flexShrink: 0, color: "text.secondary" }}>
<ListCellRenderer field={fields.generatedAt} value={report.generated_at} />
</Box>
)}
<Box sx={{ display: "flex", gap: 0.5, flexShrink: 0 }}> <Box sx={{ display: "flex", gap: 0.5, flexShrink: 0 }}>
<Button size="small" variant="contained" startIcon={<VisibilityIcon />} onClick={() => onView(report.id)}> <Button size="small" variant="contained" startIcon={<VisibilityIcon />} onClick={() => onView(report.id)}>
View View

View File

@@ -4,7 +4,7 @@ import CloseIcon from "@mui/icons-material/Close";
import CachedIcon from "@mui/icons-material/Cached"; import CachedIcon from "@mui/icons-material/Cached";
import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown"; import KeyboardArrowDownIcon from "@mui/icons-material/KeyboardArrowDown";
import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp"; import KeyboardArrowUpIcon from "@mui/icons-material/KeyboardArrowUp";
import { FkMultiSelectField, useResource, formatCurrency, formatDateTime } from "../../react-openapi"; import { FkMultiSelectField, useResource, formatCurrency } from "../../react-openapi";
import type { FieldConfig } from "../../react-openapi"; import type { FieldConfig } from "../../react-openapi";
import { StatCard } from "../common/components/StatCard"; import { StatCard } from "../common/components/StatCard";
import { TransactionList } from "../common/components/TransactionList"; import { TransactionList } from "../common/components/TransactionList";
@@ -266,7 +266,7 @@ export function ReportViewer({ id, version, fields, onClose, onRegenerated }: Re
</Typography> </Typography>
<Box sx={{ display: "flex", gap: 1.5, flexWrap: "wrap" }}> <Box sx={{ display: "flex", gap: 1.5, flexWrap: "wrap" }}>
<Typography variant="caption" color="text.secondary"> <Typography variant="caption" color="text.secondary">
flow {report.flow} · generated {formatDateTime(report.generated_at ?? report.created_at)} flow {report.flow} · generated {report.generated_at ?? report.created_at}
</Typography> </Typography>
{range && ( {range && (
<Typography variant="caption" color="text.disabled"> <Typography variant="caption" color="text.disabled">