From 2fb2769bca8ec63fa2d2af234e5b3641c40a2aec Mon Sep 17 00:00:00 2001 From: faisolavolut Date: Fri, 21 Mar 2025 10:05:05 +0700 Subject: [PATCH] feat: add NotificationSheet component for displaying notifications with enhanced UI --- components/ui/notification.tsx | 93 ++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 components/ui/notification.tsx diff --git a/components/ui/notification.tsx b/components/ui/notification.tsx new file mode 100644 index 0000000..ec06494 --- /dev/null +++ b/components/ui/notification.tsx @@ -0,0 +1,93 @@ +import { FC, useState } from "react"; +import { SheetBetter } from "./sheet"; +import { NotificationUnread } from "@/lib/svg/NotificationUnread"; +import { X } from "lucide-react"; +import { ListUI } from "../list/ListUI"; +import { events } from "@/lib/utils/event"; +import { apix } from "@/lib/utils/apix"; +import { getNumber } from "@/lib/utils/getNumber"; + +export const NotificationSheet: FC<{ children?: any; className?: string }> = ({ + children, + className, +}) => { + const [isNotification, setNotification] = useState(false); + return ( + + {children ? children : } + + } + side="right" + onOpenChange={(event) => { + setNotification(event); + }} + showClose={false} + className="p-0" + > +
+
+
+

Notification

+
+ +
{ + setNotification(false); + }} + > + +
+
+
+ { + return ( + <> +
+
+
+
+ ANNOUNCEMENT +
+
March 17, 2025
+
+

+ Join our online event and learn how to make money online +

+
+
+ + ); + }} + onLoad={async (param: any) => { + const params = await events("onload-param", { + ...param, + }); + const result: any = await apix({ + port: "recruitment", + value: "data.data.job_postings", + path: `/api/job-postings${params}`, + validate: "array", + }); + return result; + }} + onCount={async () => { + const result: any = await apix({ + port: "recruitment", + value: "data.data.total", + path: `/api/job-postings?page=1&page_size=1`, + validate: "object", + }); + return getNumber(result); + }} + /> +
+
+
+ ); +};