diff --git a/tgui/packages/tgui/interfaces/DetectiveBoard/BoardTabs.tsx b/tgui/packages/tgui/interfaces/DetectiveBoard/BoardTabs.tsx index 52b72523c06..84da10160b3 100644 --- a/tgui/packages/tgui/interfaces/DetectiveBoard/BoardTabs.tsx +++ b/tgui/packages/tgui/interfaces/DetectiveBoard/BoardTabs.tsx @@ -2,15 +2,16 @@ import { Box, Button } from 'tgui-core/components'; import { classes } from 'tgui-core/react'; import { useBackend } from '../../backend'; -import type { DataCase } from './DataTypes'; +import type { DataCase } from './types'; -type BoardTabsData = { +type Data = { cases: DataCase[]; current_case: number; }; -const BoardTab = (props) => { - const { color, selected, onClick = () => {}, children } = props; +function BoardTab(props) { + const { color, selected, onClick, children } = props; + return ( { {children} ); -}; +} -export const BoardTabs = (props) => { - const { act, data } = useBackend(); +export function BoardTabs(props) { + const { act, data } = useBackend(); const { cases, current_case } = data; + return ( {cases?.map((item, index) => ( @@ -61,4 +63,4 @@ export const BoardTabs = (props) => { diff --git a/tgui/packages/tgui/interfaces/DetectiveBoard/DataTypes.tsx b/tgui/packages/tgui/interfaces/DetectiveBoard/types.ts similarity index 86% rename from tgui/packages/tgui/interfaces/DetectiveBoard/DataTypes.tsx rename to tgui/packages/tgui/interfaces/DetectiveBoard/types.ts index 400a37651cd..3322909a750 100644 --- a/tgui/packages/tgui/interfaces/DetectiveBoard/DataTypes.tsx +++ b/tgui/packages/tgui/interfaces/DetectiveBoard/types.ts @@ -19,3 +19,5 @@ export type DataEvidence = { text: string; connections: string[]; }; + +export type EvidenceFn = (evidence: DataEvidence) => void; diff --git a/tgui/packages/tgui/interfaces/PlaneMasterDebug/index.tsx b/tgui/packages/tgui/interfaces/PlaneMasterDebug/index.tsx index 23efaecd6fc..286dcd0ab64 100644 --- a/tgui/packages/tgui/interfaces/PlaneMasterDebug/index.tsx +++ b/tgui/packages/tgui/interfaces/PlaneMasterDebug/index.tsx @@ -13,7 +13,7 @@ import { Window } from '../../layouts'; import { type Connection, Connections, - type Position, + type Coordinates, } from './../common/Connections'; import { ABSOLUTE_Y_OFFSET } from './../IntegratedCircuit/constants'; import { PlaneEditor } from './PlaneEditor'; @@ -34,7 +34,7 @@ import type { } from './types'; import { PlaneDebugContext } from './usePlaneDebug'; -function getPosition(el: HTMLElement | null): Position { +function getPosition(el: HTMLElement | null): Coordinates { let xPos = 0; let yPos = 0; diff --git a/tgui/packages/tgui/interfaces/PlaneMasterDebug/types.ts b/tgui/packages/tgui/interfaces/PlaneMasterDebug/types.ts index 06057dd082f..8af5eacdf2d 100644 --- a/tgui/packages/tgui/interfaces/PlaneMasterDebug/types.ts +++ b/tgui/packages/tgui/interfaces/PlaneMasterDebug/types.ts @@ -1,6 +1,6 @@ import type { BooleanLike } from 'tgui-core/react'; -import type { Position } from '../common/Connections'; +import type { Coordinates } from '../common/Connections'; export type PlaneDebugData = { mob_name: string; @@ -63,7 +63,7 @@ export type Plane = { incoming_filters: Filter[]; outgoing_relays: Relay[]; outgoing_filters: Filter[]; - position: Position; + position: Coordinates; parents: Plane[]; depth: number; }; @@ -120,8 +120,8 @@ export type PlaneConnectorElement = { export type PlaneConnection = { // Both of these are relay/filter ref -> coordinates for that input/output - input: Position; - output: Position; + input: Coordinates; + output: Coordinates; }; export type PlaneHighlight = { diff --git a/tgui/packages/tgui/interfaces/common/Connections.tsx b/tgui/packages/tgui/interfaces/common/Connections.tsx index 068da736082..04689826bb8 100644 --- a/tgui/packages/tgui/interfaces/common/Connections.tsx +++ b/tgui/packages/tgui/interfaces/common/Connections.tsx @@ -10,16 +10,16 @@ export enum ConnectionStyle { SUBWAY_SHARP = 'subway sharp', } -export type Position = { +export type Coordinates = { x: number; y: number; }; export type Connection = { // X, Y starting point - from: Position; + from: Coordinates; // X, Y ending point - to: Position; + to: Coordinates; // Color of the line, defaults to blue color?: string; // Type of line - Curvy or Straight / angled, defaults to curvy