diff --git a/src/components/common/ErrorPage/ErrorPage.tsx b/src/components/common/ErrorPage/ErrorPage.tsx index c56ff1249a75759cfcdcc91f8dfa0d85576b303d..45c90414cc661ba1b2ad1d125f515e0425a7127c 100644 --- a/src/components/common/ErrorPage/ErrorPage.tsx +++ b/src/components/common/ErrorPage/ErrorPage.tsx @@ -16,7 +16,7 @@ import ExpandMoreIcon from "@mui/icons-material/ExpandMore"; import { ExternalButtonLink, InternalButtonLink } from "../Link"; import { theme } from "../../../style/Theme"; -interface ErrorPageProps { +export interface ErrorPageProps { title: string; subtitle: string; details?: string; diff --git a/src/stories/common/ErrorPage/ErrorPage.stories.jsx b/src/stories/common/ErrorPage/ErrorPage.stories.tsx similarity index 91% rename from src/stories/common/ErrorPage/ErrorPage.stories.jsx rename to src/stories/common/ErrorPage/ErrorPage.stories.tsx index 8fcb53dcb52af0efbbc0b852ec2ca31995683153..f8f6b4988ae53453e34f63a4bf88c5cfab8b3a93 100644 --- a/src/stories/common/ErrorPage/ErrorPage.stories.jsx +++ b/src/stories/common/ErrorPage/ErrorPage.stories.tsx @@ -1,6 +1,8 @@ +import { Meta } from "@storybook/react"; import { Button, Paper } from "@mui/material"; import { BrowserRouter } from "react-router-dom"; import { ErrorPage } from "../../../components/common/ErrorPage"; +import { ErrorPageProps } from "../../../components/common/ErrorPage/ErrorPage"; import { theme } from "../../../style/Theme"; import { SidewaysMascot, @@ -10,9 +12,9 @@ import { export default { title: "Common/ErrorPage", component: ErrorPage -}; +} as Meta<typeof ErrorPage>; -const Template = (props) => { +const Template = (props: ErrorPageProps) => { return ( <BrowserRouter> <Paper sx={{ padding: 2 }}> @@ -24,7 +26,7 @@ const Template = (props) => { const mascotDefaultProps = { width: "250px", height: "500px" }; -export const Default = (args) => <Template {...args} />; +export const Default = (args: ErrorPageProps) => <Template {...args} />; Default.args = { title: "Badger Ducks Summoned", subtitle: "HTTP 503", @@ -71,7 +73,7 @@ Suppressed: com.physics.particles.PauliExclusionFreakoutException: Pauli exclusi ` }; -export const Customized = (args) => <Template {...args} />; +export const Customized = (args: ErrorPageProps) => <Template {...args} />; Customized.args = { ...Default.args, titleProps: { variant: "h1", color: theme.palette.error.main },