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

const { Text } = Typography

const MissingPlaceholder = ({ message, hasBackground = true }) => {
  return (
    <Card
      size='small'
      style={{
        background: hasBackground == false ? 'transparent' : undefined,
        border: 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
}

export default MissingPlaceholder
