1- import { cn } from "@/lib/utils" ;
1+ import { clsx , cn } from "@/lib/utils" ;
22import React , { SVGProps } from "react" ;
33
4- function DisplayContainer ( { children, className } : { children : React . ReactNode , className ?: string } ) {
4+ function DisplayContainer ( { children, className, bottom , As = 'div' , containerClassName , waveColors } : { children : React . ReactNode , className ?: string , bottom ?: boolean , As ?: keyof JSX . IntrinsicElements , containerClassName ?: string , waveColors ?: SVGWaveColors } ) {
55 return (
6- < div className = " drop-shadow-xl xl:w-4/5 mx-auto" >
7- < div className = { cn ( "p-8 md:p-16 lg:p-24 w-[98.6%] bg-card mx-auto rounded-t-xl drop-shadow-lg relative -z-10 flex flex-col items-center" , className ) } >
6+ < As className = { clsx ( " drop-shadow-xl xl:w-4/5 mx-auto flex relative group" , bottom ? 'flex-col-reverse' : 'flex-col' , containerClassName ) } >
7+ < div className = { cn ( "w-[98.6%] bg-card mx-auto drop-shadow-lg relative flex flex-col items-center -z-[1]" , bottom ? 'rounded-b-xl' : 'rounded-t-xl' , className ) } >
88 { children }
99 </ div >
10- < SVGComponent className = "- mt-1" />
11- </ div >
10+ < SVGWave className = { clsx ( bottom ? "-mb-1 -scale-y-100 -scale-x-100" : "- mt-1") } { ... waveColors } />
11+ </ As >
1212 ) ;
1313}
1414
15- const SVGComponent = ( props : SVGProps < SVGSVGElement > ) => (
15+ type SVGWaveColors = { c1 ?:string , c2 ?:string , c3 ?:string }
16+
17+ export const SVGWave = ( { c1, c2, c3, ...props } : SVGProps < SVGSVGElement > & SVGWaveColors ) => (
1618 < svg
1719 id = "Layer_1"
1820 data-name = "Layer 1"
@@ -23,22 +25,22 @@ const SVGComponent = (props: SVGProps<SVGSVGElement>) => (
2325 >
2426 < path
2527 d = "m1062.77,24.16s-43.27,280.48-802.45-.54l802.45.54Z"
26- className = "fill-primary drop-shadow-xl"
28+ className = { c3 || "fill-primary drop-shadow-xl" }
2729 fillRule = "evenodd"
2830 strokeMiterlimit = { 10 }
2931 strokeWidth = { 1.73 }
3032 />
3133 < path
3234 d = "m1444.65,112.37s-282.25,85.09-532.85-45.77l-1.82-31.45L1438.4,4.55l6.24,107.82Z"
33- className = "fill-secondary drop-shadow-md"
35+ className = { c2 || "fill-secondary drop-shadow-md" }
3436 fillRule = "evenodd"
3537 strokeWidth = { 0 }
3638 />
3739 < path
3840 d = "m1447,136.18V0H0v71.23h0c0,12.62,8.46,23.69,20.65,27,388.24,105.43,592.19,42.39,769.5-2.3,180.93-45.61,334.11-84.22,627.06,58.08,13.44,6.53,29.8-2.88,29.8-17.82Z"
3941 fillRule = "evenodd"
4042 // strokeWidth={0}
41- className = "fill-card drop-shadow-xl"
43+ className = { c1 || "fill-card drop-shadow-xl" }
4244 />
4345 </ svg >
4446) ;
0 commit comments