File size: 1,508 Bytes
d530f14
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
"use client";

import React from "react";
import { motion } from "framer-motion";
import CurvyRect from "@/components/shared/layout/curvy-rect";
import { cn } from "@/utils/cn";
import {
  Dialog,
  DialogTrigger,
  DialogPortal,
  DialogOverlay,
  DialogClose,
  DialogHeader,
  DialogFooter,
  DialogTitle,
  DialogDescription,
  DialogContent as ShadDialogContent,
} from "@/components/ui/shadcn/dialog";

type AppDialogContentProps = React.ComponentPropsWithoutRef<
  typeof ShadDialogContent
> & {
  withCurvyRect?: boolean;
  bodyClassName?: string;
};

export function AppDialogContent({
  className,
  children,
  withCurvyRect = true,
  bodyClassName,
  ...props
}: AppDialogContentProps) {
  return (
    <ShadDialogContent
      className={cn(
        "sm:rounded-16 p-0 border border-border-faint bg-white relative overflow-hidden",
        className,
      )}
      {...props}
    >
      {withCurvyRect && (
        <CurvyRect className="absolute inset-0 pointer-events-none" allSides />
      )}
      <motion.div
        initial={{ opacity: 0, scale: 0.985, y: 24 }}
        animate={{ opacity: 1, scale: 1, y: 0 }}
        transition={{ type: "spring", stiffness: 300, damping: 24, mass: 0.9 }}
        className={cn("relative p-16 pb-12", bodyClassName)}
      >
        {children}
      </motion.div>
    </ShadDialogContent>
  );
}

export {
  Dialog,
  DialogTrigger,
  DialogPortal,
  DialogOverlay,
  DialogClose,
  DialogHeader,
  DialogFooter,
  DialogTitle,
  DialogDescription,
};