import { Dialog, Transition } from '@headlessui/react'; import { Fragment, useState } from 'react'; import { useNavigate } from 'react-router-dom'; import { User } from '@app/auth/components/user'; import { CancelIcon, LoaderIcon, PlusIcon } from '@shared/icons'; import { useAccount } from '@utils/hooks/useAccount'; export function NewMessageModal() { const navigate = useNavigate(); const [isOpen, setIsOpen] = useState(false); const { status, account } = useAccount(); const follows = account ? JSON.parse(account.follows) : []; const closeModal = () => { setIsOpen(false); }; const openModal = () => { setIsOpen(true); }; const openChat = (pubkey: string) => { closeModal(); navigate(`/app/chat/${pubkey}`); }; return ( <>
New chat
All messages will be encrypted, but anyone can see who you chat
{status === 'loading' ? (
) : ( follows.map((follow) => (
)) )}
); }