Broaden the Awaab's Law panel to cover other condition issues

Coordinators record non-damp/mould observations (e.g. wasp nests) in the
same comments field, but the section was framed entirely around damp and
mould. Reframe the panel copy and table titles around "condition issues",
keep "Damp, Mould" up front so the Awaab's Law urgency still leads, and
mark the damp/mould rows specifically with a red badge column so they
don't blend into the broader list.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Khalim Conn-Kowlessar 2026-05-28 15:33:08 +00:00
parent 62e9c548f1
commit 9e3df59ea0
2 changed files with 25 additions and 5 deletions

View file

@ -106,6 +106,7 @@ export default function DampMouldRiskPanel({
const surveyColumns: (keyof ClassifiedDeal)[] = [
"dealname",
"landlordPropertyId",
"dampMouldFlag",
"majorConditionIssueDescription",
"majorConditionIssuePhotosS3",
];
@ -113,6 +114,7 @@ export default function DampMouldRiskPanel({
const surveyLabels: Partial<Record<keyof ClassifiedDeal, string>> = {
dealname: "Address",
landlordPropertyId: "Property Ref",
dampMouldFlag: "Damp & Mould",
majorConditionIssueDescription: "Surveyor Notes",
majorConditionIssuePhotosS3: "Photo Evidence",
};
@ -120,6 +122,7 @@ export default function DampMouldRiskPanel({
const coordColumns: (keyof ClassifiedDeal)[] = [
"dealname",
"landlordPropertyId",
"dampMouldFlag",
"dampMouldAndRepairComments",
"coordinator",
];
@ -127,6 +130,7 @@ export default function DampMouldRiskPanel({
const coordLabels: Partial<Record<keyof ClassifiedDeal, string>> = {
dealname: "Address",
landlordPropertyId: "Property Ref",
dampMouldFlag: "Damp & Mould",
dampMouldAndRepairComments: "Comments",
coordinator: "Coordinator",
};
@ -145,7 +149,7 @@ export default function DampMouldRiskPanel({
</div>
<div>
<h3 className="text-base font-semibold text-gray-800">
Awaab&apos;s Law Damp & Mould Risk
Awaab&apos;s Law Damp, Mould & Other Condition Issues
</h3>
<p className="text-sm text-gray-500 mt-0.5">
Comparison of flags raised at survey vs coordination stage
@ -159,7 +163,7 @@ export default function DampMouldRiskPanel({
<ShieldAlert className="h-4 w-4 text-emerald-600" />
</div>
<p className="text-sm font-medium text-emerald-700">
No damp or mould flags recorded for this project.
No condition issues recorded for this project.
</p>
</div>
) : (
@ -174,7 +178,7 @@ export default function DampMouldRiskPanel({
color="red"
onClick={() =>
onOpenTable(
"Damp & Mould — Survey Stage Flags",
"Condition Issues — Survey Stage",
risk.surveyFlagDeals,
surveyColumns,
surveyLabels
@ -190,7 +194,7 @@ export default function DampMouldRiskPanel({
color="red"
onClick={() =>
onOpenTable(
"Damp & Mould — Coordination Stage Flags",
"Condition Issues — Coordination Stage",
risk.coordinatorFlagDeals,
coordColumns,
coordLabels
@ -208,7 +212,7 @@ export default function DampMouldRiskPanel({
{risk.coordinatorFlagCount - risk.surveyFlagCount} additional{" "}
{risk.coordinatorFlagCount - risk.surveyFlagCount === 1 ? "property was" : "properties were"}{" "}
</span>
flagged for damp & mould at the coordination stage that{" "}
flagged with condition issues at the coordination stage that{" "}
{risk.coordinatorFlagCount - risk.surveyFlagCount === 1 ? "was" : "were"} not
identified during the initial survey.
</p>

View file

@ -34,6 +34,19 @@ const NO_COMMENT_PLACEHOLDER =
"Damp & mould discovered — no note from coordinator";
const COMMENT_PREVIEW_LIMIT = 60;
function DampMouldBadgeCell({ value }: { value: unknown }) {
const isYes =
typeof value === "string" && value.trim().toLowerCase() === "yes";
if (!isYes) return null;
return (
<span className="inline-flex items-center gap-1 rounded-full bg-red-100 px-2 py-0.5 text-xs font-semibold text-red-700 border border-red-200">
Damp & Mould
</span>
);
}
function DampMouldCommentCell({ value }: { value: unknown }) {
const comment = typeof value === "string" ? value.trim() : "";
@ -176,6 +189,9 @@ export default function DrillDownTable({
if (key === "dampMouldAndRepairComments") {
return <DampMouldCommentCell value={value} />;
}
if (key === "dampMouldFlag") {
return <DampMouldBadgeCell value={value} />;
}
return (
<span className="text-sm text-gray-800">
{value != null ? String(value) : (