shoc-frontend-new/src/components/common/detail-field.tsx
Arthur Bassi a3e8a533b1 fix(ui): align shared board plumbing with ky v2 and react-router
- api.ts: use ky v2 hook object args, prefix (not prefixUrl), and normalizeApiRequestError
- replace react-router-dom with react-router in layout, topbar, and vendor-pos view
- move MUI style props (justifyContent, alignItems, flexWrap, display, fontWeight) into sx
- resource-list-table/query-key: use local types instead of missing work-order-list module
2026-07-17 13:31:56 -03:00

36 lines
990 B
TypeScript

import { Box, Typography } from "@mui/material";
type DetailFieldHighlight = "green" | "yellow" | "red";
type DetailFieldProps = {
label: string;
value: string;
className?: string;
highlight?: DetailFieldHighlight | "";
};
export function DetailField({ label, value, className, highlight }: DetailFieldProps) {
const colorClass =
highlight === "green"
? "text-green-600"
: highlight === "yellow"
? "text-yellow-600"
: highlight === "red"
? "text-red-600"
: undefined;
return (
<Box className={className}>
<Typography variant="caption" color="text.secondary" sx={{ display: "block" }}>
{label}
</Typography>
<Typography variant="body2" className={colorClass}>
{value}
</Typography>
</Box>
);
}
export function DetailFieldGrid({ children }: { children: React.ReactNode }) {
return <Box className="grid grid-cols-1 gap-4 sm:grid-cols-2 lg:grid-cols-3">{children}</Box>;
}