-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(ui): where builder issues (#6478)
Co-authored-by: Jarrod Flesch <jarrodmflesch@gmail.com>
- Loading branch information
1 parent
e3222f2
commit 42222cd
Showing
5 changed files
with
208 additions
and
43 deletions.
There are no files selected for viewing
21 changes: 21 additions & 0 deletions
21
packages/ui/src/elements/RenderCustomClientComponent/index.tsx
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,21 @@ | ||
import React from 'react' | ||
|
||
export type RenderCustomComponentProps = { | ||
CustomComponent?: React.ComponentType<any> | ||
DefaultComponent: React.ComponentType<any> | ||
componentProps?: Record<string, any> | ||
} | ||
|
||
export const RenderCustomClientComponent: React.FC<RenderCustomComponentProps> = (props) => { | ||
const { CustomComponent, DefaultComponent, componentProps = {} } = props | ||
|
||
if (CustomComponent) { | ||
return <CustomComponent {...componentProps} /> | ||
} | ||
|
||
if (DefaultComponent) { | ||
return <DefaultComponent {...componentProps} /> | ||
} | ||
|
||
return null | ||
} |
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
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