-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
✨ Implement the structure and webform fieldset preview
Both simply display their nested children.
- Loading branch information
1 parent
926295e
commit 2980a2f
Showing
3 changed files
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import type {FieldsetComponentSchema} from '@open-formulieren/types'; | ||
|
||
import type {StructureSubtreeProps} from '@/registry/types'; | ||
|
||
const StructureSubtreePreview: React.FC<StructureSubtreeProps<FieldsetComponentSchema>> = ({ | ||
component: {components}, | ||
renderSubtree, | ||
}) => <>{renderSubtree(components)}</>; | ||
|
||
export default StructureSubtreePreview; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import type {FieldsetComponentSchema} from '@open-formulieren/types'; | ||
|
||
import {FieldSet} from '@/components/formio'; | ||
import type {WebformPreviewProps} from '@/registry/types'; | ||
|
||
const WebformPreview: React.FC<WebformPreviewProps<FieldsetComponentSchema>> = ({ | ||
component, | ||
renderSubtree, | ||
}) => { | ||
const {label, hideHeader, tooltip, components} = component; | ||
return ( | ||
<FieldSet label={hideHeader ? undefined : label} tooltip={tooltip}> | ||
{renderSubtree(components)} | ||
</FieldSet> | ||
); | ||
}; | ||
|
||
export default WebformPreview; |