sn: 침수예측현황 침수위험도 수정

This commit is contained in:
2026-09-17 14:04:51 +09:00
parent 94b2e84c10
commit 8cc9f0d291
@@ -192,14 +192,21 @@ const validateFilters = (filters: Filters) => {
const buildRowId = (row: ApiRow) =>
`${row.ctpvCd}:${row.sggCd}:${row.rainBeginningDateTime}:${row.analysisDateTime}:${row.predictionHour}`;
const isDangerGrade = (value: string) => {
/** 침수위험도 등급을 목록 배지의 고정 의미색으로 변환한다. */
const getFloodRiskGradeClassName = (value: string) => {
const grade = String(value ?? "")
.trim()
.toUpperCase();
if (!grade || grade === "-" || grade.includes("정상") || grade === "NORMAL") {
return false;
if (grade.includes("위험") || grade === "DANGER") {
return "bg-[#dc2626] text-white";
}
return true;
if (grade.includes("경계") || grade === "WARNING") {
return "bg-[#f97316] text-white";
}
if (grade.includes("주의") || grade === "CAUTION") {
return "bg-[#facc15] text-[#713f12]";
}
return "sn-popup-badge-normal";
};
export default function FldngPredcPrstPopupContent() {
@@ -570,11 +577,7 @@ export default function FldngPredcPrstPopupContent() {
renderCell={(row, headId) =>
headId === "floodRiskGrade" ? (
<span
className={`sn-popup-badge min-w-[5.6rem] ${
isDangerGrade(row.floodRiskGrade)
? "sn-popup-badge-danger"
: "sn-popup-badge-normal"
}`}
className={`sn-popup-badge min-w-[5.6rem] ${getFloodRiskGradeClassName(row.floodRiskGrade)}`}
>
{row.floodRiskGrade || "-"}
</span>
@@ -596,8 +599,16 @@ export default function FldngPredcPrstPopupContent() {
}
/>
<div className="px-1 text-xl text-muted-foreground">
행을 선택하면 해당 시군구·빈도의 도시침수지도로 이동합니다.
<div className="space-y-1 px-1 text-xl text-muted-foreground">
<p>
30년빈도 이상인 경우{" "}
<span className="font-semibold text-[#dc2626]">위험</span>, 10년빈도
이상인 경우{" "}
<span className="font-semibold text-[#f97316]">경계</span>, 2년빈도
이상인 경우{" "}
<span className="font-semibold text-[#ca8a04]">주의</span>
</p>
<p>행을 선택하면 해당 시군구·빈도의 도시침수지도로 이동합니다.</p>
</div>
</section>
</StandardPopupLayout>