import { Card, Text, Box, Flex } from "@mantine/core"; import type { LineConfig, TLine, TStation } from "../untils/types"; import classes from "./Component.module.css"; import TerminalCLI from "./TerminalXTerm"; import type { Socket } from "socket.io-client"; import { IconCircleCheckFilled } from "@tabler/icons-react"; import { memo } from "react"; const CardLine = ({ line, selectedLines, setSelectedLines, socket, stationItem, updateStatus, }: { line: TLine; selectedLines: TLine[]; setSelectedLines: (lines: React.SetStateAction) => void; socket: Socket | null; stationItem: TStation; updateStatus: (value: LineConfig) => void; }) => { return ( val.id === line.id) ? { backgroundColor: "#8bf55940" } : {} } onClick={(e) => { e.preventDefault(); e.stopPropagation(); if (selectedLines.find((val) => val.id === line.id)) setSelectedLines(selectedLines.filter((val) => val.id !== line.id)); else setSelectedLines((pre) => [...pre, line]); }} >
Line: {line.lineNumber || line.line_number} - {line.port}{" "} {line.status === "connected" && ( )}
{/* PID: WS-C3560CG-8PC-S
SN: FGL2240307M
VID: V01
*/} { e.preventDefault(); e.stopPropagation(); }} style={{ height: "175px", width: "300px" }} > {}} updateStatus={updateStatus} />
{/* */}
); }; export default memo(CardLine);