diff --git a/src/components/generic/Table/index.tsx b/src/components/generic/Table/index.tsx index ebd5bae4..1603fd00 100755 --- a/src/components/generic/Table/index.tsx +++ b/src/components/generic/Table/index.tsx @@ -92,7 +92,7 @@ export const Table = ({ headings, rows }: TableProps) => { { {sortedRows.map((row, index) => ( // biome-ignore lint/suspicious/noArrayIndexKey: TODO: Once this table is sortable, this should get fixed. - + {row.map((item, index) => ( + index === 0 ? + + {item} + : void; } +function shortNameFromNode(node: ReturnType["nodes"][number]): string { + const shortNameOfNode = node.user?.shortName ?? (node.user?.macaddr + ? `${base16 + .stringify(node.user?.macaddr.subarray(4, 6) ?? []) + .toLowerCase()}` + : `${numberToHexUnpadded(node.num).slice(-4)}`); + return String(shortNameOfNode); +} + const NodesPage = (): JSX.Element => { const { nodes, hardware, connection } = useDevice(); console.log(connection); @@ -89,7 +98,6 @@ const NodesPage = (): JSX.Element => { { ]} rows={filteredNodes.map((node) => [
- +
, - -

setSelectedNode(node)} - className="cursor-pointer" - > - {node.user?.shortName ?? - (node.user?.macaddr - ? `${base16 - .stringify(node.user?.macaddr.subarray(4, 6) ?? []) - .toLowerCase()}` - : `${numberToHexUnpadded(node.num).slice(-4)}`)} -

, -

setSelectedNode(node)} - className="cursor-pointer" + onKeyUp={(evt)=>{ evt.key === "Enter" && setSelectedNode(node) }} + className="cursor-pointer underline" + tabIndex={0} + role="button" > {node.user?.longName ?? (node.user?.macaddr @@ -138,9 +135,9 @@ const NodesPage = (): JSX.Element => { .match(/.{1,2}/g) ?.join(":") ?? "UNK"} , - + {node.lastHeard === 0 ? ( -

Never

+

Never

) : ( )}