import React, { memo } from 'react'; import { Modal, Row, Col, Tag, Divider } from 'antd'; import { CloseCircleFilled, WarningFilled, CheckCircleFilled, InfoCircleFilled } from '@ant-design/icons'; const DetailNotification = memo(function DetailNotification({ visible, onCancel, form, selectedData }) { const getIconAndColor = (type) => { switch (type) { case 'critical': return { IconComponent: CloseCircleFilled, color: '#ff4d4f', bgColor: '#fff1f0', tagColor: 'error', }; case 'warning': return { IconComponent: WarningFilled, color: '#faad14', bgColor: '#fffbe6', tagColor: 'warning', }; case 'resolved': return { IconComponent: CheckCircleFilled, color: '#52c41a', bgColor: '#f6ffed', tagColor: 'success', }; default: return { IconComponent: InfoCircleFilled, color: '#1890ff', bgColor: '#e6f7ff', tagColor: 'processing', }; } }; const { IconComponent, color, bgColor, tagColor } = selectedData ? getIconAndColor(selectedData.type) : {}; return ( {selectedData && (
{/* Header with Icon and Status */}
{IconComponent && }
{selectedData.type.toUpperCase()}
{selectedData.title}
{/* Information Grid */}
PLC
{selectedData.plc}
Tag
{selectedData.tag}
Engineer
{selectedData.engineer}
Waktu
{selectedData.time}
{/* Status */}
Status
{selectedData.isRead ? 'Sudah Dibaca' : 'Belum Dibaca'}
{/* Additional Info */}
Catatan: Notifikasi ini telah dikirim ke engineer yang bersangkutan untuk ditindaklanjuti sesuai dengan prosedur yang berlaku.
)}
); }); export default DetailNotification;