1
- import { cn } from "@/lib/utils" ;
1
+ import { clsx , cn } from "@/lib/utils" ;
2
2
import React , { SVGProps } from "react" ;
3
3
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 } ) {
5
5
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 ) } >
8
8
{ children }
9
9
</ 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 >
12
12
) ;
13
13
}
14
14
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 ) => (
16
18
< svg
17
19
id = "Layer_1"
18
20
data-name = "Layer 1"
@@ -23,22 +25,22 @@ const SVGComponent = (props: SVGProps<SVGSVGElement>) => (
23
25
>
24
26
< path
25
27
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" }
27
29
fillRule = "evenodd"
28
30
strokeMiterlimit = { 10 }
29
31
strokeWidth = { 1.73 }
30
32
/>
31
33
< path
32
34
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" }
34
36
fillRule = "evenodd"
35
37
strokeWidth = { 0 }
36
38
/>
37
39
< path
38
40
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"
39
41
fillRule = "evenodd"
40
42
// strokeWidth={0}
41
- className = "fill-card drop-shadow-xl"
43
+ className = { c1 || "fill-card drop-shadow-xl" }
42
44
/>
43
45
</ svg >
44
46
) ;
0 commit comments