Download next.js/examples/cms-payload/components/Hero/index.tsx from Devendra174/react-code-dataset: direct link, hf CLI and curl.
- Browser
- Download file 539 Bytes
-
https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-payload/components/Hero/index.tsx
- Command line
-
hf download hf://datasets/Devendra174/react-code-dataset/next.js/examples/cms-payload/components/Hero/index.tsx
-
curl -L -o index.tsx https://huggingface.co/datasets/Devendra174/react-code-dataset/resolve/main/next.js/examples/cms-payload/components/Hero/index.tsx
539 Bytes
| "use client"; | |
| import React from "react"; | |
| import { Page } from "../../payload-types"; | |
| import { HighImpactHero } from "./HighImpact"; | |
| import { MediumImpactHero } from "./MediumImpact"; | |
| import { LowImpactHero } from "./LowImpact"; | |
| const heroes = { | |
| highImpact: HighImpactHero, | |
| mediumImpact: MediumImpactHero, | |
| lowImpact: LowImpactHero, | |
| }; | |
| export const Hero: React.FC<Page["hero"]> = (props) => { | |
| const { type } = props; | |
| const HeroToRender = heroes[type]; | |
| if (!HeroToRender) return null; | |
| return <HeroToRender {...props} />; | |
| }; | |