import dynamic from 'next/dynamic' const SanityImage = dynamic(() => import('components/ui/sanity-image')) const Link = dynamic(() => import('components/ui/link')) const Text = dynamic(() => import('components/ui/text')) interface HeroProps { variant: string text?: string label?: string title: string image: object | any desktopImage: object | any link: { title: string reference: { title: string slug: { current: string } } } } type HeroSize = keyof typeof heroSize const heroSize = { fullScreen: 'aspect-[3/4] lg:aspect-auto lg:h-[calc(100vh-4rem)]', halfScreen: 'aspect-square max-h-[60vh] lg:aspect-auto lg:min-h-[60vh]', } const Hero = ({ variant, title, text, label, image, link }: HeroProps) => { const heroClass = heroSize[variant as HeroSize] || heroSize.fullScreen return (
{image && ( )}
{label && ( {label} )} {title ? ( {title} ) : ( No title provided yet )} {text && ( {label} )} {link?.reference && ( {link?.title ? link.title : link.reference.title} )}
) } export default Hero