import { clientId, q } from "@thorium/context/AppContext"; import { useStation } from "@thorium/routes/station/useStation"; import Button from "@thorium/ui/Button"; import SearchableInput, { DefaultResultLabel } from "@thorium/ui/SearchableInput"; import { useState } from "react"; import { Label, TextArea } from "react-aria-components"; export function ComposePage() { const { shipId, station } = useStation(); const [addressBook] = q.longRangeComm.addressBook.useNetRequest({ shipId }); const [contactId, setContactId] = useState(-1); const [message, setMessage] = useState(""); return (
{ return addressBook; }} ResultLabel={({ active, result, selected }) => (

{result.name || result.entityName}

)} selected={addressBook.find((a) => a.id === contactId) || null} setSelected={(value) => { if (!value) return; setContactId(value.id); q.thorium.genericEvent.netSend({ clientId, eventName: "longRangeComposerDestinationSet", properties: `${value.id}`, }); }} displayValue={(item) => item?.name || item?.entityName || ""} />