import { useEffect, useState } from 'react';
import { AnimatePresence, motion } from 'framer-motion';
import { PING_EMOJIS, type Role, type RoomState } from '@two-keys/shared';
import { socket } from '../lib/socket';
import { ROLE_TEXT } from '../lib/theme';
/** Partner's online dot, what they're looking at, and the ping buttons. */
export function PartnerStatus({ state }: { state: RoomState }) {
const [open, setOpen] = useState(false);
const partner = state.partner;
const name = partner?.seat ? state.game.roles[partner.seat].name : 'Partner';
return (
{open && (
// Anchored to the header bar (not the button) so it always fits a narrow screen.
{partner?.online ? 'Online' : 'Offline. They can rejoin with the same link.'}
{partner?.online && partner.viewing ? ` ยท looking at ${partner.viewing}` : ''}