MessageDetail.jsx 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. import styles from '@/pages/Hr/Notification/index.less'
  2. import { Drawer, Tag, Typography } from 'antd'
  3. import { useIntl } from '@umijs/max'
  4. import MarkDown from 'react-markdown'
  5. const MessageDetail = props => {
  6. const { item: { id, title, createTime, content, msgType } = {}, ...otherProps } = props
  7. const intl = useIntl()
  8. if (!id) return null
  9. return (
  10. <Drawer {...otherProps} className="zh-drawer" getContainer={() => document.getElementById('root')}>
  11. <div className="px-5 vditor-reset h-full">
  12. <div className="max-h-20vh">
  13. <span className="pt-5 block">
  14. <Tag color="purple">{intl.formatMessage({ id: `component.globalHeader.${msgType}` })}</Tag>
  15. </span>
  16. <h1 className={['text-xl pr-6 mt-3', styles.NotificationCont].join(' ')}>{title}</h1>
  17. <span className="text-hex-aaa">{createTime}</span>
  18. <div className="w-22 h-[1px] bg-hex-ddd mt-3 mb-5 " />
  19. </div>
  20. <div
  21. className={[
  22. 'overflow-y-auto max-h-80vh py-3 px-4 bg-hex-f9f9f9 rounded-md boxShadow',
  23. styles.NotificationCont
  24. ].join(' ')}
  25. >
  26. <Typography.Paragraph>
  27. <MarkDown>{content}</MarkDown>
  28. </Typography.Paragraph>
  29. </div>
  30. </div>
  31. </Drawer>
  32. )
  33. }
  34. export default MessageDetail