import { useEffect, useState, type ReactNode } from "react";
import clsx from "clsx";
import { ChevronRight, type LucideIcon } from "lucide-react";
import { InboxAvatar } from "../MessagesPage/InboxRow.tsx";
import PresenceDot from "../../../components/PresenceDot/PresenceDot";
// The deck lays the page out as a list beside the person it has open from a tablet up.
const WIDE_QUERY = "(min-width: 768px)";
export const useWideFamilyLayout = (): boolean => {
const read = () => typeof window !== "undefined" && typeof window.matchMedia === "function" && window.matchMedia(WIDE_QUERY).matches;
const [wide, setWide] = useState(read);
useEffect(() => {
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
const query = window.matchMedia(WIDE_QUERY);
const update = () => setWide(query.matches);
update();
query.addEventListener?.("change", update);
return () => query.removeEventListener?.("change", update);
}, []);
return wide;
};
export type PersonTone = "full" | "wait" | undefined;
export const PersonAvatar = ({ name, photoUrl, tone, presenceRef }: {
name: string;
photoUrl?: string;
tone?: PersonTone;
presenceRef?: string;
}) => (