import React, { Children } from "react"; import { useTranslation } from "react-i18next"; import { Grid, GridItem, JumpLinks, JumpLinksItem, PageSection, } from "@patternfly/react-core"; import { FormPanel } from "./FormPanel"; import "./scroll-form.css"; type ScrollFormProps = { sections: string[]; children: React.ReactNode; }; // This must match the page id created in App.tsx unless another page section has been given hasScrollableContent const mainPageContentId = "#kc-main-content-page-container"; const spacesToHyphens = (string: string): string => { return string.replace(/\s+/g, "-"); }; export const ScrollForm = ({ sections, children }: ScrollFormProps) => { const { t } = useTranslation("common"); const nodes = Children.toArray(children); return ( {sections.map((cat, index) => ( {nodes[index]} ))} {sections.map((cat) => ( // note that JumpLinks currently does not work with spaces in the href {cat} ))} ); };