chore: add label for checkbox and radio fields (#1607)

This commit is contained in:
Catalin Pit
2025-02-28 12:09:38 +02:00
committed by David Nguyen
parent d970976299
commit e79d762710
4 changed files with 85 additions and 0 deletions

View File

@ -181,6 +181,23 @@ export const DocumentSigningFieldContainer = ({
</button>
)}
{(field.type === FieldType.RADIO || field.type === FieldType.CHECKBOX) &&
field.fieldMeta?.label && (
<div
className={cn(
'absolute -top-16 left-0 right-0 rounded-md p-2 text-center text-xs text-gray-700',
{
'bg-foreground/5 border-border border': !field.inserted,
},
{
'bg-documenso-200 border-primary border': field.inserted,
},
)}
>
{field.fieldMeta.label}
</div>
)}
{children}
</FieldRootContainer>
</div>