shoc-frontend-new/src/app/(protected)/vendors/_components/vendor-status-badge.tsx
Codex Review Integration 038ce263da fix(vendors): vendor detail parity with the design prototype (SH-253)
Three divergences in the vendor detail drawer:

- The header rendered the company as a subtitle under a title that had
  already fallen back to the company, printing the same name twice when
  the row carried no technician. The subtitle is now dropped when it
  would repeat the title.
- The Google Maps link appeared only when a URL was stored, unlabelled,
  so an empty value left no trace of the field. It is now a labelled
  field below Address that reads em-dash when unset, as every other
  field in the panel does.
- The status sat immediately beside Total Jobs. It now sits opposite it
  at the right edge, and reuses the vendors table's dot-plus-text badge
  so the state never reads by colour alone.
2026-08-19 13:22:11 -03:00

20 lines
623 B
TypeScript

import { Box, Stack } from "@mui/material";
import { Text } from "@/components/ui/text";
/** Dot plus text, so the status never reads by colour alone. */
export function VendorStatusBadge({ isActive }: { isActive: boolean }) {
return (
<Stack direction="row" spacing={1} sx={{ alignItems: "center" }}>
<Box
component="span"
sx={{
width: 6,
height: 6,
borderRadius: "9999px",
backgroundColor: isActive ? "success.main" : "text.secondary",
}}
/>
<Text variant="description">{isActive ? "Active" : "Inactive"}</Text>
</Stack>
);
}