import React from 'react';
import { HeaderProps, ListProps, NodeProps, NodeState } from './types';
const InfoHeader = ({ children, onClickHandler }: HeaderProps) =>
+ {children}
;
const InfoList = ({ children, isOpen }: ListProps) =>
isOpen
?
: null;
export default class GeneralInfoNode extends React.Component<
NodeProps,
NodeState
> {
public state = {
isOpen: false
};
public toggleVisibility = () =>
this.setState(prevState => ({ isOpen: !prevState.isOpen }));
public render() {
const {
toggleVisibility,
props: { innerList, headerContent },
state: { isOpen }
} = this;
return (
{headerContent}
{innerList}
);
}
}