diff --git a/src/components/PageComponents/Map/NodeDetail.tsx b/src/components/PageComponents/Map/NodeDetail.tsx index 71dbad96..4e57f75a 100644 --- a/src/components/PageComponents/Map/NodeDetail.tsx +++ b/src/components/PageComponents/Map/NodeDetail.tsx @@ -16,31 +16,53 @@ import { Dot, LockIcon, LockOpenIcon, + MessageSquareIcon, MountainSnow, Star, } from "lucide-react"; +import { + Tooltip, + TooltipContent, + TooltipPortal, + TooltipProvider, + TooltipTrigger, +} from "@radix-ui/react-tooltip"; +import { useAppStore } from "@core/stores/appStore.ts"; +import { useDevice } from "@core/stores/deviceStore.ts"; export interface NodeDetailProps { node: ProtobufType.Mesh.NodeInfo; } export const NodeDetail = ({ node }: NodeDetailProps) => { + const { setChatType, setActiveChat } = useAppStore(); + const { setActivePage } = useDevice(); const name = node.user?.longName || `!${numberToHexUnpadded(node.num)}`; + const shortName = node.user?.shortName ?? "UNK"; const hwModel = node.user?.hwModel ?? 0; const hardwareType = Protobuf.Mesh.HardwareModel[hwModel]?.replaceAll("_", " ") ?? `${hwModel}`; + function handleDirectMessage() { + setChatType("direct"); + setActiveChat(node.num); + setActivePage("messages"); + } + return (
- - -
+ + +
{ + // Required to prevent DM tooltip auto-appearing on creation + e.stopPropagation(); + }}> {node.user?.publicKey && node.user?.publicKey.length > 0 ? ( { ) : ( )} -
- + + + + + + + + Direct Message {shortName} + + + + + + +
@@ -70,7 +115,7 @@ export const NodeDetail = ({ node }: NodeDetailProps) => { {!!node.deviceMetrics?.batteryLevel && (