import useLocalState from "@/state/state"; import type { Ship } from "@/types/urbit"; import Sigil from "./Sigil"; import ShipModal from "./modals/ShipModal"; export default function ({ p, size, color, noClickOnName, }: { p: Ship; size: number; color?: string; noClickOnName?: boolean; }) { const { setModal } = useLocalState(); // TODO revisit this when %whom updates const avatar = (
); const tooLong = (s: string) => (s.length > 15 ? " too-long" : ""); function openModal(e: React.MouseEvent) { if (noClickOnName) return; e.stopPropagation(); setModal(); } const name = (

{p.length > 28 ? "Anon" : p}

); return (
{avatar} {name}
); } export function SigilOnly({ p, size, color }: any) { const { setModal } = useLocalState(); function openModal(e: React.MouseEvent) { e.stopPropagation(); setModal(); } return (
); }