fix: update DocumentSlots component to include optional mode and use requirement.id as key

This commit is contained in:
estifanos
2026-08-11 10:35:49 +00:00
parent 63ef5d8a49
commit deb650f22f

View File

@@ -65,6 +65,7 @@ export function DocumentSlots({
const required = requirements.filter( const required = requirements.filter(
(r) => (r) =>
r.mode === 'ALWAYS' || r.mode === 'ALWAYS' ||
r.mode === 'OPTIONAL' ||
(r.mode === 'CONDITIONAL' && conditionHolds(r.conditionExpression, formData)), (r.mode === 'CONDITIONAL' && conditionHolds(r.conditionExpression, formData)),
); );
@@ -99,7 +100,7 @@ export function DocumentSlots({
return ( return (
<Card <Card
key={requirement.key} key={requirement.id}
withBorder withBorder
padding="md" padding="md"
style={{ style={{
@@ -122,6 +123,11 @@ export function DocumentSlots({
conditional conditional
</Badge> </Badge>
)} )}
{requirement.mode === 'OPTIONAL' && (
<Badge size="xs" variant="light" color="gray">
optional
</Badge>
)}
{uploaded && !flagRemark && ( {uploaded && !flagRemark && (
<Badge size="xs" color="teal" leftSection={<IconCheck size={10} />}> <Badge size="xs" color="teal" leftSection={<IconCheck size={10} />}>
uploaded uploaded