"use client"; import { useEffect, useRef } from "react"; import "@whereby.com/browser-sdk/embed"; import { Box, Button, HStack, useToast, Text } from "@chakra-ui/react"; interface WherebyEmbedProps { roomUrl: string; } export default function WherebyEmbed({ roomUrl }: WherebyEmbedProps) { const wherebyRef = useRef(null); const toast = useToast(); useEffect(() => { if (roomUrl && !localStorage.getItem("recording-notice-dismissed")) { const toastId = toast({ position: "top", duration: null, render: ({ onClose }) => ( This webinar is being recorded. By continuing, you agree to our{" "} ), }); return () => { toast.close(toastId); }; } }, [roomUrl, toast]); return ( ); }