import { CodeList } from "@thorium/cards/CodeCyphers/CodeList"; import Printable from "@thorium/components/printable"; import { clientId, q } from "@thorium/context/AppContext"; import { useStation } from "@thorium/routes/station/useStation"; import Button from "@thorium/ui/Button"; import { cn } from "@thorium/utils/cn"; import { useState } from "react"; export function CodeCyphers() { const { shipId } = useStation(); const [cyphers] = q.codeCyphers.availableCyphers.useNetRequest({ shipId }); const [selectedCypherName, setSelectedCypher] = useState(null); const selectedCypher = cyphers.find((c) => c.name === selectedCypherName); function setCypher(name: string) { setSelectedCypher(name); q.thorium.genericEvent.netSend({ clientId, eventName: "cypher-selected", properties: name }); } return (

Cyphers

    {cyphers.map((c) => (
  • setCypher(c.name)} > {c.code}
  • ))}

=== Code Cypher ===

{selectedCypher && }
); }