import { QuestStatus, QuestType } from '@rpg-engine/shared';
import { Story } from '@storybook/react';
import React from 'react';
import {
  IQuestListProps,
  QuestList,
} from '../../../components/Quests/QuestList';
import { RPGUIRoot } from '../../../components/RPGUI/RPGUIRoot';

export default {
  title: 'Features/Quest/Quest List',
  component: QuestList,
};

const Template: Story<IQuestListProps> = args => (
  <RPGUIRoot>
    <QuestList {...args} />
  </RPGUIRoot>
);

export const Default = Template.bind({});

const IQuestMock = [
  {
    _id: '6317996c77f2420047a20b55',
    rewards: [
      {
        id: '66cd2b039b486b00436a4ace',
        itemKeys: ['iron-armor'],
        qty: 1,
      },
    ],
    objectives: [
      {
        id: '66cd2b049b486b00436a4b1a',
        type: QuestType.Interaction,
        status: QuestStatus.Pending,
        targetNPCkey: 'durgan-miner',
        items: [{ itemKey: 'iron-ingot', qty: 10 }],
      },
    ],
    npcId: '6317996b77f2420047a20825',
    title: 'Iron Ingot Craftsmanship',
    key: 'interaction-durgan-miner',
    description:
      "Employ your pickaxe to mine ore, followed by utilizing your blacksmith hammer. Select 'Use with,' then target an anvil to forge ingots. Provide me with 10 Iron Ingots, and I shall craft you an Iron Armor!",
    createdAt: '2024-08-27T01:25:24.285+0000',
    updatedAt: '2024-08-27T01:25:24.304+0000',
    status: QuestStatus.Pending,
  },
];

Default.args = {
  quests: IQuestMock,
};
