gendesign/frontend/src/components/analytics/ObjectChecksBadges.tsx
lekss361 f8c382f885
All checks were successful
Deploy / changes (push) Successful in 5s
Deploy / build-backend (push) Successful in 1m35s
Deploy / build-worker (push) Successful in 2m37s
Deploy / build-frontend (push) Successful in 3m2s
Deploy / deploy (push) Successful in 56s
feat(22k): object page — full exposure 9 blocks (sales/quartirography/metro/photos/docs/specs/checks) (#310)
2026-05-17 15:56:39 +00:00

45 lines
1.4 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import type { ObjectCheckRow } from "@/types/analytics";
const CHECK_LABELS: Record<string, string> = {
no_problems: "Нет проблемных объектов",
docs: "Документы опубликованы",
timing: "Сроки соблюдены",
photos: "Актуальные фото",
bankruptcy: "Не банкрот",
declaration: "Декларация обновлена",
};
export function ObjectChecksBadges({ checks }: { checks: ObjectCheckRow[] }) {
if (checks.length === 0) {
return (
<p style={{ color: "#9ca3af", fontSize: 13 }}>
Данные проверок ещё не загружены.
</p>
);
}
return (
<div style={{ display: "flex", flexWrap: "wrap", gap: 8 }}>
{checks.map((c) => (
<div
key={c.check_type}
style={{
display: "flex",
alignItems: "center",
gap: 6,
padding: "6px 12px",
borderRadius: 20,
fontSize: 13,
fontWeight: 500,
background: c.passed ? "#dcfce7" : "#fee2e2",
color: c.passed ? "#065f46" : "#991b1b",
border: `1px solid ${c.passed ? "#bbf7d0" : "#fecaca"}`,
}}
>
<span style={{ fontSize: 15 }}>{c.passed ? "✓" : "✗"}</span>
{CHECK_LABELS[c.check_type] ?? c.check_type}
</div>
))}
</div>
);
}