/* eslint-disable react/destructuring-assignment */
import React from 'react';
import TemplateOne from '.';
import Verify from '~images/icons/verify';

export default {
  title: 'Theme/Layout/Header/Games/Template One',
  component: TemplateOne,
  argTypes: {
    headerBonus: {
      control: 'boolean',
    },
  },
};

const Template = (args) => {
  const { headerBonus, ...rest } = args;

  const filteredModules = headerBonus ? args.page.sections.header.modules : [];

  return (
    <TemplateOne
      {...rest}
      page={{
        ...args.page,
        sections: {
          ...args.page.sections,
          header: { ...args.page.sections.header, modules: filteredModules },
        },
      }}
    />
  );
};

export const Default = Template.bind({});
Default.args = {
  page: {
    title: 'Game slot',
    relation: {
      third_rating: 3.6,
      first_rating: 4.2,
      rtp: 30,
      average_rating: 4.4,
      thumbnail_filename_object: {
        filename: 'holiday-season-game-thumbnail.jpeg',
      },
      logo: { filename: '1651670485/davincis-gold-casino-logo.png' },
    },
    sections: {
      header: {
        modules: [
          {
            name: 'bonus',
            value: {
              bonuses: {
                main: {
                  one_liner: '20 Free Spins No Deposit Bonus + 300% & 555 Spins Welcome Bonus',
                },
              },
              logo: {
                filename: '1651670485/davincis-gold-casino-logo.png',
              },
              links: { main: 'test' },
              status: 'active',
            },
          },
        ],
      },
    },
  },
  image: <Verify />,
  headerBonus: true,
};
