edited the pibi request ui

This commit is contained in:
Khalim Conn-Kowlessar 2026-05-08 12:53:35 +00:00
parent 3793a55b44
commit 7bcac4f65a

View file

@ -131,11 +131,52 @@ const COLUMNS = [
data-testid={`pibi-measure-select-${r.id}`}
className="rounded border border-gray-200 px-1.5 py-0.5 text-xs text-gray-800 focus:outline-none focus:ring-1 focus:ring-brandblue/40 w-[130px]"
>
{MEASURE_NAMES.map((m) => (
<option key={m} value={m}>
{m}
</option>
))}
{(() => {
const approved = MEASURE_NAMES.filter((m) =>
meta.approvedMeasures.includes(m),
);
const proposed = MEASURE_NAMES.filter(
(m) =>
meta.proposedMeasures.includes(m) &&
!meta.approvedMeasures.includes(m),
);
const other = MEASURE_NAMES.filter(
(m) =>
!meta.approvedMeasures.includes(m) &&
!meta.proposedMeasures.includes(m),
);
return (
<>
{approved.length > 0 && (
<optgroup label="Approved">
{approved.map((m) => (
<option key={m} value={m}>
{m}
</option>
))}
</optgroup>
)}
{proposed.length > 0 && (
<optgroup label="Proposed">
{proposed.map((m) => (
<option key={m} value={m}>
{m}
</option>
))}
</optgroup>
)}
{other.length > 0 && (
<optgroup label="Other">
{other.map((m) => (
<option key={m} value={m}>
{m}
</option>
))}
</optgroup>
)}
</>
);
})()}
</select>
) : (
<span className="text-xs text-gray-800">{r.measureName}</span>