({
children,
className,
containerClassName,
background,
contained = true,
hero = false,
fullViewport = false,
animate = true,
style: customStyle,
...props
}: SectionProps)
| 28 | } |
| 29 | |
| 30 | export function Section({ |
| 31 | children, |
| 32 | className, |
| 33 | containerClassName, |
| 34 | background, |
| 35 | contained = true, |
| 36 | hero = false, |
| 37 | fullViewport = false, |
| 38 | animate = true, |
| 39 | style: customStyle, |
| 40 | ...props |
| 41 | }: SectionProps) { |
| 42 | const style = { |
| 43 | backgroundColor: background, |
| 44 | ...customStyle, |
| 45 | } |
| 46 | const isMobile = useIsMobile() |
| 47 | |
| 48 | const content = contained ? ( |
| 49 | <div className={cn('codebuff-container relative z-10', containerClassName)}> |
| 50 | {children} |
| 51 | </div> |
| 52 | ) : ( |
| 53 | children |
| 54 | ) |
| 55 | |
| 56 | return ( |
| 57 | <motion.section |
| 58 | className={cn('relative', className)} |
| 59 | initial={false} |
| 60 | animate={{ |
| 61 | minHeight: fullViewport ? '95dvh' : 'auto', |
| 62 | }} |
| 63 | transition={{ |
| 64 | duration: 1, |
| 65 | ease: [0.32, 0.72, 0, 1], |
| 66 | }} |
| 67 | style={{ |
| 68 | ...style, |
| 69 | paddingTop: hero ? '1rem' : '10rem', |
| 70 | paddingBottom: isMobile && hero ? '5rem' : '10rem', |
| 71 | }} |
| 72 | {...props} |
| 73 | > |
| 74 | {content} |
| 75 | </motion.section> |
| 76 | ) |
| 77 | } |
nothing calls this directly
no test coverage detected