import { Link, useQuery, Routes } from "blitz";
import { IoChevronForward } from "react-icons/io5";
import getConversationsQuery from "../queries/get-conversations";
import { formatRelativeDate } from "../../core/helpers/date-formatter";
import { useEffect } from "react";
import PhoneInitLoader from "../../core/components/phone-init-loader";
import EmptyMessages from "./empty-messages";
export default function ConversationsList() {
const [conversations, query] = useQuery(getConversationsQuery, {});
useEffect(() => {
if (!conversations) {
const pollInterval = setInterval(() => query.refetch(), 1500);
return () => clearInterval(pollInterval);
}
}, [conversations, query]);
if (!conversations) {
// we're still importing messages from twilio
return