diff --git a/src/components/Library/ContentTOCLine.tsx b/src/components/Library/ContentTOCLine.tsx new file mode 100644 index 0000000..9001184 --- /dev/null +++ b/src/components/Library/ContentTOCLine.tsx @@ -0,0 +1,108 @@ +import Button from "components/Button"; +import Chip from "components/Chip"; +import { + GetLibraryItemQuery, + GetWebsiteInterfaceQuery, +} from "graphql/operations-types"; +import { prettyinlineTitle, prettySlug } from "queries/helpers"; +import { useState } from "react"; + +type ContentTOCLineProps = { + content: GetLibraryItemQuery["libraryItems"]["data"][number]["attributes"]["contents"]["data"][number]; + parentSlug: string; + langui: GetWebsiteInterfaceQuery["websiteInterfaces"]["data"][number]["attributes"]; +}; + +export default function ContentTOCLine( + props: ContentTOCLineProps +): JSX.Element { + const content = props.content; + const langui = props.langui; + + const [opened, setOpened] = useState(false); + + return ( +
+ {content.attributes.range[0].__typename === "ComponentRangePageRange" + ? content.attributes.range[0].starting_page + : ""} +
+ {content.attributes.content.data ? ( +- {content.attributes.range[0].__typename === - "ComponentRangePageRange" - ? content.attributes.range[0].starting_page - : ""} -
- {content.attributes.content.data ? ( -