import type { Meta } from "@storybook/react";
import React from 'react';
import { FriendList } from "../../../components/Friends/FriendList";
import { RPGUIRoot } from "../../../components/RPGUI/RPGUIRoot";

const meta :Meta = {
  title: 'Features/Friend System/Friend List',
  component: FriendList
};

export default meta;


const friends = Array.from({ length: 15 }, (_, i) => ({
  _id: i.toString(),
  name: `Friend ${i}`,
  isOnline: i % 2 === 0,
}));

const characters = Array.from({ length: 1 }, (_, i) => ({
  _id: i.toString(),
  name: `Character ${i}`,
  isOnline: i % 2 === 0,
}));

const Template = () => {
  return <RPGUIRoot>
   <FriendList
    friends={friends}
    friendRequests={characters}
    searchedCharacters={characters}
    onClose={() => console.log('close')}
    onOpenPrivateMessage={(character) => console.log(character)}
    onRemoveFriend={(character) => console.log(character)}
    onSendFriendRequest={(character) => console.log(character)}
    onSearch={(characterName) => console.log(characterName)}
    onAcceptRequest={(character) => console.log(character)}
    onRejectRequest={(character) => console.log(character)}
    onBlur={() => console.log('blur')}
    onFocus={() => console.log('focus')}
    onAddFriend={() => console.log('add friend')}
    onBackFriendList={() => console.log('back friend list')}
/>
  </RPGUIRoot>;
}


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