import { CCBaseShapeUtil } from '../CCBaseShapeUtil' import { CCBaseShape } from '../cc-types' import { NodeProperty } from './cc-graph-shared' import { ccGraphShapeProps, getDefaultCCTopicNodeProps } from './cc-graph-props' import { getNodeStyles } from './cc-graph-styles' import { NODE_THEMES, NODE_TYPE_THEMES } from './cc-graph-styles' import { CCTopicNodeProps } from './cc-graph-types' export interface CCTopicNodeShape extends CCBaseShape { type: 'cc-topic-node' props: CCTopicNodeProps } export class CCTopicNodeShapeUtil extends CCBaseShapeUtil { static type = 'cc-topic-node' as const static props = ccGraphShapeProps['cc-topic-node'] getDefaultProps(): CCTopicNodeShape['props'] { const defaultProps = getDefaultCCTopicNodeProps() const theme = NODE_THEMES[NODE_TYPE_THEMES[CCTopicNodeShapeUtil.type]] return { ...defaultProps, headerColor: theme.headerColor, } } // Override to nullify the default node component DefaultComponent = () => null renderContent = (shape: CCTopicNodeShape) => { const styles = getNodeStyles(shape.type) return (
) } }