import React from "react"; import clsx from "clsx"; import { LandingStartActionIcon } from "./icons/landing-start-action"; import { LandingCopyCommandButton } from "./landing-copy-command-button"; import { LandingPlaygroundModal } from "./landing-playground-modal"; import { useLocation } from "@docusaurus/router"; import { useColorMode } from "@docusaurus/theme-common"; import { useInView } from "framer-motion"; import Link from "@docusaurus/Link"; export const LandingTryItSection = ({ className }: { className?: string }) => { const [wizardOpen, setWizardOpen] = React.useState(false); const onClick = React.useCallback(() => { setWizardOpen(true); }, []); const { search, hash } = useLocation(); const [params, setParams] = React.useState>({}); React.useEffect(() => { const _params = new URLSearchParams(search); const paramsObj: Record = {}; // @ts-expect-error no downlevel iteration for (const [key, value] of _params.entries()) { paramsObj[key] = value; } setParams(paramsObj); }, [search]); const scrollToItem = React.useCallback(() => { const playgroundElement = document.getElementById("playground"); if (playgroundElement) { playgroundElement.scrollIntoView({ behavior: "smooth", block: "start", inline: "nearest", }); } }, []); React.useEffect(() => { if (params.playground || hash === "#playground") { scrollToItem(); } }, [params.playground, hash]); React.useEffect(() => { if (wizardOpen) { scrollToItem(); } }, [wizardOpen]); return (

Get started now!

Choose OpenPanel Enterprise or Community edition and start hosting websites in minutes.

); }; const LandingTryItOptionsSection = ({ onClick, className, }: { onClick: () => void; className?: string; }) => { return (

Sign up for OpenPanel Enterprise version and offer premium features to your customers.

Go Enterprise
or

Get OpenPanel Community edition now and begin hosting websites within just 5 minutes.

); }; const LandingTryItWizardSection = ({ className, visible, }: { className?: string; visible: boolean; }) => { const ref = React.useRef(null); const inView = useInView(ref, { margin: "100px", }); const iframeRef = React.useRef(null); const { colorMode } = useColorMode(); React.useEffect(() => { // when color mode changes, post a message to the iframe // to update its color mode if (iframeRef.current) { iframeRef.current.contentWindow?.postMessage( { type: "colorMode", colorMode, }, "*", ); } }, [colorMode, visible]); return (
{inView ? (