github.com/turbot/steampipe@v1.7.0-rc.0.0.20240517123944-7cef272d4458/ui/dashboard/src/components/dashboards/Error/index.stories.js (about)

     1  import Error from "./index";
     2  import { PanelStoryDecorator } from "../../../utils/storybook";
     3  
     4  const story = {
     5    title: "Utilities/Error",
     6    component: Error,
     7  };
     8  
     9  export default story;
    10  
    11  const Template = (args) => (
    12    <PanelStoryDecorator definition={args} panelType="error" />
    13  );
    14  
    15  export const NoError = Template.bind({});
    16  NoError.args = {
    17    error: null,
    18  };
    19  
    20  export const StringError = Template.bind({});
    21  StringError.args = {
    22    error: "Something went wrong!",
    23  };
    24  
    25  export const ErrorObjectLowerCaseErrorMessage = Template.bind({});
    26  ErrorObjectLowerCaseErrorMessage.args = {
    27    error: { message: "Something went wrong!" },
    28  };
    29  
    30  export const ErrorObjectUpperCaseErrorMessage = Template.bind({});
    31  ErrorObjectUpperCaseErrorMessage.args = {
    32    error: { Message: "Something went wrong!" },
    33  };
    34  
    35  export const ErrorObjectNoErrorMessage = Template.bind({});
    36  ErrorObjectNoErrorMessage.args = {
    37    error: { some: "value" },
    38  };
    39  
    40  export const UnknownErrorObject = Template.bind({});
    41  UnknownErrorObject.args = {
    42    error: 12,
    43  };