import React, { memo } from 'react'
import { ReactComponent as CheckIcon } from 'assets/check.svg'
import { isEqual } from 'lodash'

import { StyleSheet } from 'react-native'
import { CellProps } from './TableTypes'

const BooleanCell = ({ cell, theme }: CellProps) => {
  if (cell.value === true) {
    return <CheckIcon style={styles.icon} fill={theme.cellText.color} />
  }

  return null
}

const styles = StyleSheet.create({
  icon: {
    width: 24,
    height: 24,
  },
})

export default memo(BooleanCell, isEqual)
