import { Card, Flex, Typography } from 'antd'
import InfoCircleIcon from '../../Icons/InfoCircleIcon'
import PropTypes from 'prop-types'

const { Text } = Typography

const MissingPlaceholder = ({
  message,
  hasBackground = true,
  hasBorder = true
}) => {
  return (
    <Card
      size='small'
      style={{
        background: hasBackground == false ? 'transparent' : undefined,
        border:
          hasBorder == false
            ? 'none'
            : hasBackground == false
              ? '1px solid rgb(0 0 0 / 7%)'
              : undefined
      }}
    >
      <Flex
        justify='center'
        gap={'small'}
        style={{
          height: '100%'
        }}
        align='center'
      >
        <Text type='secondary'>
          <InfoCircleIcon />
        </Text>
        <Text type='secondary'>{message}</Text>
      </Flex>
    </Card>
  )
}

MissingPlaceholder.propTypes = {
  message: PropTypes.string.isRequired,
  hasBackground: PropTypes.bool,
  hasBorder: PropTypes.bool
}

export default MissingPlaceholder
