import React, { Fragment } from "react"; import './data-entry-group.css'; import { RightIcon, DownIcon } from "../../components/icons"; interface DataEntryProps { name: string; } interface DataEntryState { collapsed: boolean; } class DataEntryGroup extends React.Component { constructor(props) { super(props); this.state = { collapsed: true }; this.toggle = this.toggle.bind(this); } toggle() { this.setState((state) => ({ collapsed: !state.collapsed })); } render() { return (
{this.props.name}
{this.props.children}
); } } const CollapseIcon: React.FunctionComponent<{collapsed: boolean}> = (props) => ( {props.collapsed ? : } ); export { DataEntryGroup };