import SanityImage from '@/components/ui/sanity-image/sanity-image'; import Link from 'components/ui/link/link'; import Text from 'components/ui/text/text'; interface HeroProps { variant: string; text?: string; label?: string; title: string; image: 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-[50vh] lg:aspect-auto lg:min-h-[50vh]' }; 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 && (
{text}
)} {link?.reference && ( {link?.title ? link.title : link.reference.title} )}
); }; export default Hero;