import { Fragment, useEffect, useState } from "react"; import { useNavigate } from "@remix-run/react"; import { Transition } from "@headlessui/react"; import { useAtom } from "jotai"; import useNotifications, { notificationDataAtom } from "~/features/core/hooks/use-notifications"; export default function Notification() { useNotifications(); const navigate = useNavigate(); const [notificationData] = useAtom(notificationDataAtom); const [show, setShow] = useState(notificationData !== null); const close = () => setShow(false); const actions = buildActions(); useEffect(() => { setShow(notificationData !== null); }, [notificationData]); return (
{notificationData?.data.recipient}
{notificationData?.body}