import type { Component, JSX } from "solid-js";

type Props = {
  title: JSX.Element;
  open?: boolean;
  children: JSX.Element;
};

const Zippy: Component<Props> = (props) => {
  return (
    <details class="zippy" open={props.open}>
      <summary>{props.title}</summary>
      <div class="zippy-body">{props.children}</div>
    </details>
  );
};

export default Zippy;
