import { Flex, Tag } from 'antd'
import IdDisplay from './IdDisplay'
import LockIcon from '../../Icons/LockIcon'
import PropTypes from 'prop-types'

const LockIndicator = ({ lock }) => {
  if (!lock?.locked || lock?.locked == false) {
    return
  }
  return (
    <Flex gap={'small'} align='center'>
      <Tag icon={<LockIcon />} style={{ margin: 0 }} color={'orange'} />
      <IdDisplay
        id={lock?.user}
        type={'user'}
        longId={false}
        showCopy={false}
      />
    </Flex>
  )
}

LockIndicator.propTypes = {
  lock: PropTypes.object
}

export default LockIndicator
