import {AchievementData} from "@nitro/renderer";
import {FC} from "react";

import {AutoGrid} from "../../../../common";
import {AchievementListItemView} from "./AchievementListItemView";

interface AchievementListViewProps {
  achievements: AchievementData[];
}

export const AchievementListView: FC<AchievementListViewProps> = props => {
  const {achievements = null} = props;

  return (
    <AutoGrid columnCount={6} columnMinWidth={50} columnMinHeight={50}>
      {achievements && achievements.length > 0 && achievements.map((achievement, index) => <AchievementListItemView key={index} achievement={achievement} />)}
    </AutoGrid>
  );
};
