import { Breadcrumb, LinkNewWindow, Spinner, } from "@pantheon-systems/pds-toolkit-react"; import StepCreateCollection from "./StepCreateCollection"; import { Link, useNavigate } from "react-router-dom"; import StepConnectToken from "./StepConnectToken"; import { useState } from "react"; import CollectionReady from "../../../components/collections/CollectionReady"; const steps = [ { id: 1, title: "First, connect Content Publisher to your WordPress site", }, { id: 2, title: "Create your first collection", }, ]; export default function CreateCollection() { const [step, setStep] = useState(steps[0]); const [isReady, setIsReady] = useState(false); const [isLoading, setIsLoading] = useState(false); const [loadingStep, setLoadingStep] = useState( "Creating your collection..." ); const navigate = useNavigate(); if (isReady) { return ; } if (isLoading) { return (
); } return (
Back]} />

Step {step.id} of {steps.length}

{step.title}

{step.id === 1 && (

This setup is for those who don't have a collection yet.{" "} View documentation

)}
{step.id === 1 ? ( { setStep(steps[1]); }} onCancel={() => { navigate("/"); }} /> ) : ( { setIsReady(true); }} onCancel={() => { navigate("/"); }} onLoadingChange={setIsLoading} onLoadingStepChange={setLoadingStep} /> )}
); }