import React from "react"; import { CharacterTheme } from "@dndbeyond/character-rules-engine/es"; import { GD_VehicleBlockProps } from "../../utils/Component"; import VehicleBlockActionStations from "./VehicleBlockActionStations"; import VehicleBlockActionSummaries from "./VehicleBlockActionSummaries"; import VehicleBlockActions from "./VehicleBlockActions"; import VehicleBlockComponents from "./VehicleBlockComponents"; import VehicleBlockFeatures from "./VehicleBlockFeatures"; import VehicleBlockHeader from "./VehicleBlockHeader"; import VehicleBlockPrimary from "./VehicleBlockPrimary"; import VehicleBlockShell from "./VehicleBlockShell"; interface Props extends GD_VehicleBlockProps { isInteractive: boolean; onComponentClick?: (componentId: number, vehicleId: number) => void; onActionStationClick?: (stationId: number, vehicleId: number) => void; shouldCoalesce: boolean; theme: CharacterTheme; } export default class VehicleBlock extends React.PureComponent { static defaultProps = { isInteractive: false, shouldCoalesce: true, featuresProps: null, actionsProps: null, actionSummariesProps: null, actionStationsProps: null, componentsProps: null, }; render() { const { headerProps, primaryProps, actionSummariesProps, featuresProps, actionsProps, actionStationsProps, componentsProps, shellProps, isInteractive, onComponentClick, onActionStationClick, shouldCoalesce, theme, } = this.props; return ( {featuresProps !== null && } {actionSummariesProps !== null && ( )} {actionStationsProps !== null && ( )} {componentsProps !== null && ( )} {actionsProps !== null && } ); } }