'use client' import { FC, ReactNode, useState } from 'react'; import { Button } from '@/components/ui/button'; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from '@/components/ui/dialog'; import useMobileView from '@/hooks/useMobileView'; type Props = { children?: ReactNode }; const ForgotPassword: FC = ({ children }) => { const { isMobile } = useMobileView() const [showDialog, setShowDialog] = useState(false) const handleForgotPassword = () => { const name = process.env.NEXT_PUBLIC_HATS_SUPPORT_NAME const phone = process.env.NEXT_PUBLIC_HATS_SUPPORT_PHONE const text = `Hello ${name}, here I convey that I forgot my HIS Attendance Task System (H.A.T.s) account password, I ask for your help to reset my account password, thank you in advance :)` let url = `https://wa.me/${phone}?text=${text}` if (isMobile) { url = `https://api.whatsapp.com/send?phone=${phone}&text=${text}` } else { url = `https://web.whatsapp.com/send?phone=${phone}&text=${text}` } window.open(url, '_blank')!.focus(); } return ( <> {children ? children : } Confirm forgot password Are you sure to continue this process? ); } export default ForgotPassword;