<commit_before>import { Pull } from '../pull';
import { actionMessage } from '../utils';
import { Link, Box, useStyleConfig } from "@chakra-ui/react"
import { memo } from "react"
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faWarning, faMinusCircle, faEye, faEyeSlash, faSnowflake, faMinusSquare } from '@fortawesome/free-solid-svg-icons'

export const Flags = memo(
function Flags({pull}: {pull: Pull}) {
   const devBlock = pull.getDevBlock();
   const draftBlock = pull.isDraft();
   const readyButNoCI = pull.isReady() && !pull.isCiRequired();
   const deployBlock = pull.getDeployBlock();
   const QAing = pull.getLabel("QAing");
   const externalBlock = pull.getLabel("external_block");
   const cryogenicStorage = pull.getLabel("Cryogenic Storage");
   return (<>
      {deployBlock && <PullFlag
         variant="deployBlock"
         title={actionMessage('Deploy blocked', deployBlock.data.created_at, deployBlock.data.user.login)}
         href={pull.linkToSignature(deployBlock)}
         icon={faWarning}
      />}
      {readyButNoCI && <PullFlag
         variant="deployBlock"
         title={"No CI, deploy carefully"}
         icon={faWarning}
      />}
      {devBlock && <PullFlag
         variant="devBlock"
         title={actionMessage('Dev blocked', devBlock.data.created_at, devBlock.data.user.login)}
         href={pull.linkToSignature(devBlock)}
         icon={faMinusCircle}
      />}
      {draftBlock && <PullFlag
         variant="draftBlock"
         title={"Draft"}
         icon={faMinusCircle}
      />}
      {QAing && <PullFlag
         variant="QAing"
         title={actionMessage('QA started', QAing.created_at, QAing.user)}
         icon={faEye}
      />}
      {externalBlock && <PullFlag
         variant="externalBlock"
         title={actionMessage('Externally blocked', externalBlock.created_at, externalBlock.user)}
         icon={faEyeSlash}
      />}
      {cryogenicStorage && <PullFlag
         variant="cryogenicStorage"
         title={actionMessage('Put on ice', cryogenicStorage.created_at, cryogenicStorage.user)}
         icon={faSnowflake}
      />}
   </>);
});

interface PullFlagProps {
   href?: string,
   variant: string,
   title?: string,<commit_msg>Update icon for draftBlock flag<commit_after>import { Pull } from '../pull';
import { actionMessage } from '../utils';
import { Link, Box, useStyleConfig } from "@chakra-ui/react"
import { memo } from "react"
import { IconDefinition } from '@fortawesome/fontawesome-svg-core';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import { faWarning, faMinusCircle, faEye, faEyeSlash, faSnowflake, faMinusSquare } from '@fortawesome/free-solid-svg-icons'

export const Flags = memo(
function Flags({pull}: {pull: Pull}) {
   const devBlock = pull.getDevBlock();
   const draftBlock = pull.isDraft();
   const readyButNoCI = pull.isReady() && !pull.isCiRequired();
   const deployBlock = pull.getDeployBlock();
   const QAing = pull.getLabel("QAing");
   const externalBlock = pull.getLabel("external_block");
   const cryogenicStorage = pull.getLabel("Cryogenic Storage");
   return (<>
      {deployBlock && <PullFlag
         variant="deployBlock"
         title={actionMessage('Deploy blocked', deployBlock.data.created_at, deployBlock.data.user.login)}
         href={pull.linkToSignature(deployBlock)}
         icon={faWarning}
      />}
      {readyButNoCI && <PullFlag
         variant="deployBlock"
         title={"No CI, deploy carefully"}
         icon={faWarning}
      />}
      {devBlock && <PullFlag
         variant="devBlock"
         title={actionMessage('Dev blocked', devBlock.data.created_at, devBlock.data.user.login)}
         href={pull.linkToSignature(devBlock)}
         icon={faMinusCircle}
      />}
      {draftBlock && <PullFlag
         variant="draftBlock"
         title={"Draft"}
         icon={faMinusSquare}
      />}
      {QAing && <PullFlag
         variant="QAing"
         title={actionMessage('QA started', QAing.created_at, QAing.user)}
         icon={faEye}
      />}
      {externalBlock && <PullFlag
         variant="externalBlock"
         title={actionMessage('Externally blocked', externalBlock.created_at, externalBlock.user)}
         icon={faEyeSlash}
      />}
      {cryogenicStorage && <PullFlag
         variant="cryogenicStorage"
         title={actionMessage('Put on ice', cryogenicStorage.created_at, cryogenicStorage.user)}
         icon={faSnowflake}
      />}
   </>);
});

interface PullFlagProps {
   href?: string,
   variant: string,
   title?: string,
{'fraction_non_alphanumeric': 0.13571736320551486, 'fraction_numerical': 0.0, 'mean_word_length': 3.1866546438232644, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2624999', 'n_tokens_mistral': 1436, 'n_tokens_neox': 1369, 'n_words': 265}