import React, { useState } from "react"; import ResultsCard from "./ResultsCard.js"; import { createReportDecorator } from "./storybook/ReportDecorator.js"; import { ReportContext, sampleSketchReportContextValue, } from "../context/index.js"; import Skeleton from "./Skeleton.js"; import { LayerToggle } from "./LayerToggle.js"; import { Collapse } from "./Collapse.js"; import fixtures from "../testing/fixtures/index.js"; import DataDownload from "./DataDownload.js"; import ToolbarCard from "./ToolbarCard.js"; const contextValue = sampleSketchReportContextValue({ visibleLayers: [], exampleOutputs: [ { functionName: "area", sketchName: "My Sketch", results: { area: 704, }, }, ], }); export const basic = () => ( {(data: any) => (

This zone is {data.area} sq km. Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut nisi beatae, officiis perferendis quis inventore quisquam? Provident doloremque inventore, natus beatae quam nisi eius quidem deserunt, aperiam aliquid corrupti eveniet.

)}
); const geographyIds = ["nearshore", "offshore"]; export const extraParams = () => { const [geography, setGeography] = useState("nearshore"); const geographySwitcher = (e: any) => { console.log("changing geography to", e.target.value); setGeography(e.target.value); }; return ( <> {" "} {() => ( <>

Cur geography: {geography}

Note that smoke tests are not setup to generate output for more than one extraParams value. In fact, by default the extraParams value is not set for a story. Storybook is also not setup to load more than one output. So This story demonstrates how to use a UI switcher to control passing different values to extraParams, but it won't change the output. The approach to seeing what the output would be for different values of extraParams is to run the smoke tests is to create multiple independent smoke tests, each with different values.

)}
); }; export const loadingState = () => ( {(data: any) => (

This zone is {data.area} sq km. Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque illo ipsum odit rerum delectus consequuntur corrupti, magnam quas? Ipsam quis soluta labore. Laudantium tenetur illo voluptatem temporibus totam et incidunt.

)}
); export const customSkeleton = () => ( } > {(data: any) => (

This zone is {data.area} sq km. Lorem ipsum dolor sit amet consectetur adipisicing elit. Neque illo ipsum odit rerum delectus consequuntur corrupti, magnam quas? Ipsam quis soluta labore. Laudantium tenetur illo voluptatem temporibus totam et incidunt.

)}
); const DefaultSkeleton = () => (
); export const errorState = () => ( {(data: any) =>

This zone is {data.area} sq km.

}
); export const noDataState = () => ( {(data: any) =>

This zone is {data.area} sq km.

}
); const ThrowComponent = () => { throw new Error("error!"); return <>; }; export const errorBoundary = () => ( {() => { return ; }} ); const loadedRightItems = ( <> ); export const customCard = () => ( {(data: any) => (

This zone is {data.area} sq km. Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut nisi beatae, officiis perferendis quis inventore quisquam? Provident doloremque inventore, natus beatae quam nisi eius quidem deserunt, aperiam aliquid corrupti eveniet.

Additional elements in here

Additional elements in here

)}
); export const customCardToggled = () => ( {(data: any) => (

This zone is {data.area} sq km. Lorem ipsum dolor sit amet consectetur adipisicing elit. Ut nisi beatae, officiis perferendis quis inventore quisquam? Provident doloremque inventore, natus beatae quam nisi eius quidem deserunt, aperiam aliquid corrupti eveniet.

Additional elements in here

Additional elements in here

)}
); export default { component: ResultsCard, title: "Components/Card/ResultsCard", decorators: [createReportDecorator(contextValue)], };