import { useEffect, useState } from "react"; import Layout from "@cloudscape-design/components/app-layout"; import { Button, Container, ContentLayout, Header, Link, SpaceBetween, TextContent, Wizard } from "@cloudscape-design/components"; import { Cards, Links, Payment, Status, Tools } from "./components"; function App() { const [activeStepIndex, setActiveStepIndex] = useState(0); const [_finished, setFinished] = useState(true); const [loading, setLoading] = useState(false); const [_paid, setPaid] = useState(false); const [total, setTotal] = useState(0); useEffect(() => { fetch('/login') .then(res => res.json()) .then(data => { console.log(data) }); }, []); const handleTotal = (num: number) => { setTotal(num); console.log(_finished); }; const handlePay = async (bool: boolean) => { console.log(_paid); setLoading(false); setPaid(bool); }; return ( <> } tools={ } navigationHide content={
Info } variant="h1" > o11y Shop
} > `Step ${stepNumber}`, collapsedStepsLabel: (stepNumber, stepsCount) => `Step ${stepNumber} of ${stepsCount}`, skipToButtonLabel: (step, stepNumber) => `Skip to ${step.title}`, cancelButton: "Cancel", previousButton: "Previous", nextButton: "Next", submitButton: "Restart", optional: "optional" }} onCancel={() => { setActiveStepIndex(0) setTotal(0) setLoading(false); }} onNavigate={({ detail }) => { setActiveStepIndex(detail.requestedStepIndex) }} onSubmit={() => { setFinished(false); setActiveStepIndex(0) setTotal(0) setLoading(false); }} activeStepIndex={activeStepIndex} isLoadingNextStep={loading} steps={[ { title: "Select your products", content: ( ) }, { title: "Complete your checkout", content: ( Payment } > ) }, { title: "Check status", isOptional: true, content: ( Order status } > ), }, { title: "Done", content: ( Done! } > Make sure to reload and explore several times to generate enough data. ) } ]} /> © {new Date().getFullYear()}, Amazon Web Services, Inc. or its affiliates. All rights reserved. Made with {" "} Cloudscape Design System
} footerSelector="#footer" /> ); } export default App;