Created
January 28, 2022 05:24
-
-
Save JacksonBates/8c350261df2a217c187e48ea3a1c373b to your computer and use it in GitHub Desktop.
This file contains hidden or 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
import { | |
RadioSelect, | |
Text, | |
} from "components"; | |
export default function FormItem({data}) { | |
const itemType = data.item_type; | |
const componentMap = { | |
radio: RadioSelect, | |
text: Text, | |
}; | |
| |
const ItemComponent = componentMap[itemType]; | |
| |
return ( | |
<ItemComponent | |
item={data} | |
/> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment