import type { Meta, StoryObj } from '@storybook/angular';

import { configProps, historyData } from './mock';

import {{! pick new delimiters for mustache }}{{=<% %>=}}{<%={{ }}=%> {{COMPONENT_CLASS_NAME}}Component {{=<% %>=}}}<%={{ }}=%>{{! revert delimiters for mustache }} from './{{COMPONENT_CLASS_NAME_KEBAB}}.component';

const meta: Meta<{{COMPONENT_CLASS_NAME}}Component> = {
  title: '{{COMPONENT_CLASS_NAME}}',
  component: {{COMPONENT_CLASS_NAME}}Component,
  excludeStories: /.*Data$/,
  render: args => {
    window.PCore.getConstants = (): any => {
      return {
        CASE_INFO: {
          CASE_INFO_ID: 'caseInfo.ID',
          INSTRUCTIONS: ''
        }
      };
    };
    window.PCore.getDataApiUtils = (): any => {
      return {
        getData: () => {
          return {
            then: (callback: any) => {
              callback(historyData);
            }
          };
        }
      };
    };
    return {
      props: {
        ...args,
        pConn$: {
          getConfigProps: () => {
            return configProps;
          },
          getValue: value => {
            return value;
          },
          getContextName: () => {
            return 'app/primary_1';
          },
          getLocalizedValue: value => {
            return value;
          }
        } as any
      }
    };
  }
};

export default meta;
type Story = StoryObj<{{COMPONENT_CLASS_NAME}}Component>;

export const {{COMPONENT_CLASS_NAME}}: Story = {
  args: {}
};
