import { type Meta, type StoryObj, argsToTemplate } from '@storybook/angular';
import { ProductShelfMetaInfoComponent } from '@isa/remission/shared/product';

const meta: Meta<ProductShelfMetaInfoComponent> = {
  component: ProductShelfMetaInfoComponent,
  title: 'remission/shared/product/ProductShelfMetaInfoComponent',
  args: {
    department: 'Reise',
    shelfLabel: 'Europa',
    productGroupKey: '311',
    productGroupValue: 'Romane TB',
    assortment: 'Basissortiment|BPrämienartikel|n',
    returnReason: 'Beschädigt',
  },
  argTypes: {
    department: {
      control: { type: 'text' },
      description: 'The department of the product.',
      defaultValue: undefined,
    },
    shelfLabel: {
      control: { type: 'text' },
      description: 'The shelf label of the product.',
      defaultValue: undefined,
    },
    productGroupKey: {
      control: { type: 'text' },
      description: 'The key of the product group.',
      defaultValue: undefined,
    },
    productGroupValue: {
      control: { type: 'text' },
      description: 'The value of the product group.',
      defaultValue: undefined,
    },
    assortment: {
      control: { type: 'text' },
      description: 'The assortment of the product.',
      defaultValue: undefined,
    },
    returnReason: {
      control: { type: 'text' },
      description: 'The reason for the return of the product.',
      defaultValue: undefined,
    },
  },
  render: (args) => ({
    props: args,
    template: `<remi-product-shelf-meta-info ${argsToTemplate(args)}></remi-product-shelf-meta-info>`,
  }),
};

export default meta;

type Story = StoryObj<ProductShelfMetaInfoComponent>;

export const Default: Story = {
  args: {
    department: 'Reise',
    shelfLabel: 'Europa',
    productGroupKey: '311',
    productGroupValue: 'Romane TB',
    assortment: 'Basissortiment|BPrämienartikel|n',
    returnReason: 'Beschädigt',
  },
};
