{"size": 942, "ext": "js", "max_stars_repo_path": "rcongui/src/components/PlayersHistory/PlayerTile/PlayerFlags.js", "max_stars_repo_name": "FlorianSW/hll_rcon_tool", "max_stars_repo_stars_event_min_datetime": "2020-03-07T13:09:21.000Z", "max_stars_repo_stars_event_max_datetime": "2022-03-19T14:24:13.000Z", "max_issues_repo_path": "rcongui/src/components/PlayersHistory/PlayerTile/PlayerFlags.js", "max_issues_repo_name": "FlorianSW/hll_rcon_tool", "max_issues_repo_issues_event_min_datetime": "2020-03-26T22:19:40.000Z", "max_issues_repo_issues_event_max_datetime": "2021-12-12T17:31:06.000Z", "max_forks_repo_path": "rcongui/src/components/PlayersHistory/PlayerTile/PlayerFlags.js", "max_forks_repo_name": "FlorianSW/hll_rcon_tool", "max_forks_repo_forks_event_min_datetime": "2020-03-03T09:44:36.000Z", "max_forks_repo_forks_event_max_datetime": "2022-03-18T07:33:39.000Z"}
{"max_stars_count": 49, "max_issues_count": 48, "max_forks_count": 48, "avg_line_length": 28.5454545455, "max_line_length": 79, "alphanum_fraction": 0.542462845}
import {
  Grid,
  Link
} from "@material-ui/core";
import React from "react";
import { List } from "immutable";
import Tooltip from "@material-ui/core/Tooltip";
import { getEmojiFlag } from "../../../utils/emoji";
import "emoji-mart/css/emoji-mart.css";

export const PlayerFlags = ({ player, classes, onDeleteFlag }) => {
  return <Grid container alignItems="center" justify="center">
    <Grid item style={{ height: "22px" }}></Grid>
    {player.get("flags", new List()).map((d) => (
      <Grid
        item
        className={classes.noPaddingMargin}
        style={{ height: "22px" }}
      >
        <Tooltip title={d.get("comment") ? d.get("comment") : "<empty>"} arrow>
          <Link
            onClick={() => window.confirm("Delete flag?")
              ? onDeleteFlag(d.get("id"))
              : ""}
          >
            {getEmojiFlag(d.get("flag"))}
          </Link>
        </Tooltip>
      </Grid>
    ))}
  </Grid>;
};
