"use client"; import { useEffect, useState } from "react"; import { useChatStore } from "@/lib/store"; export function PersonSwitcher() { const personId = useChatStore((s) => s.personId); const switchPerson = useChatStore((s) => s.switchPerson); const [mounted, setMounted] = useState(false); // Defer personId render to avoid SSR/client hydration mismatch // (server generates a fresh UUID, client rehydrates from localStorage) useEffect(() => setMounted(true), []); const short = mounted ? personId.slice(0, 8) : "\u00A0"; return (