react-icons/md#MdOutlineAccountTree TypeScript Examples

The following examples show how to use react-icons/md#MdOutlineAccountTree. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SyntaxDiagram.tsx    From website-docs with MIT License 6 votes vote down vote up
export function SyntaxDiagram({
  children,
}: {
  children: [ReactNode, ReactNode]
}) {
  const [value, setValue] = useState(0)

  return (
    <div className={root}>
      <div
        className={`${toolbar} buttons are-small are-light has-addons is-right`}>
        <button className="button is-light" onClick={() => setValue(0)}>
          <span className="icon">
            <MdOutlineAccountTree />
          </span>
          <span>
            <Trans i18nKey="syntaxDiagram.syntaxDiagram" />
          </span>
        </button>
        <button className="button is-light" onClick={() => setValue(1)}>
          <span className="icon">
            <MdCode />
          </span>
          <span>
            <Trans i18nKey="syntaxDiagram.ebnf" />
          </span>
        </button>
      </div>
      <div hidden={value !== 0} className={container}>
        {children[0]}
      </div>
      <div hidden={value !== 1}>{children[1]}</div>
    </div>
  )
}