import { GetStaticProps } from "next"; import SubPanel from "components/Panels/SubPanel"; import ContentPanel, { ContentPanelWidthSizes, } from "components/Panels/ContentPanel"; import { GetContentsQuery } from "graphql/operations-types"; import { getContents } from "graphql/operations"; import PanelHeader from "components/PanelComponents/PanelHeader"; import AppLayout from "components/AppLayout"; import LibraryContentPreview from "components/Library/LibraryContentPreview"; import { prettyinlineTitle, prettySlug } from "queries/helpers"; import { AppStaticProps, getAppStaticProps } from "queries/getAppStaticProps"; import Select from "components/Select"; import { useEffect, useState } from "react"; interface ContentsProps extends AppStaticProps { contents: GetContentsQuery["contents"]["data"]; } type GroupContentItems = Map; export default function Contents(props: ContentsProps): JSX.Element { const { langui, contents } = props; const [groupingMethod, setGroupingMethod] = useState(-1); const [groups, setGroups] = useState( getGroups(groupingMethod, contents) ); useEffect(() => { setGroups(getGroups(groupingMethod, contents)); }, [langui, groupingMethod, contents]); const subPanel = (

{langui.group_by}: