import "./style.scss" import { styled } from "@linaria/react" import { type FC, useState } from "react" import { Collapse } from "react-collapse" const StyledTocToggleButton = styled.button` cursor: pointer; border: none; text-align: left; background-color: rgba(0, 0, 0, 0); width: 100%; padding: 0.5rem; ` const StyledCollapseContainer = styled.div` * { transition: height 200ms ease-out; } ` const Toc: FC<{ data?: string }> = (props) => { const [isTocOpened, setIsTocOpened] = useState(false) if (!props.data) return <> return ( <> { setIsTocOpened((prev) => !prev) }} > Table of Contents {isTocOpened ? ( // Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. ) : ( // Font Awesome Free 6.4.0 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license (Commercial License) Copyright 2023 Fonticons, Inc. )}

) } export default Toc