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"; import useCall from "~/features/phone-calls/hooks/use-call"; export default function Notification() { useNotifications(); const navigate = useNavigate(); const [notificationData] = useAtom(notificationDataAtom); const [call, setCall] = useCall(); const [show, setShow] = useState(notificationData !== null); const close = () => setShow(false); const actions = buildActions(); useEffect(() => { setShow(notificationData !== null); }, [notificationData]); return (
{notificationData?.data.recipient}
{notificationData?.body}