/** * @file * @copyright 2020 Aleksej Komarov * @license MIT */ import { Component } from 'inferno'; import { Box } from './Box'; import { Button } from './Button'; export class Collapsible extends Component { constructor(props) { super(props); const { open } = props; this.state = { open: open || false, }; } render() { const { props } = this; const { open } = this.state; const { children, color = 'default', title, buttons, ...rest } = props; return (
{buttons &&
{buttons}
}
{open && {children}}
); } }