import React from 'react';
import { Modal, Typography, Card, Row, Col, Avatar, Tag, Button, Space } from 'antd';
import {
UserOutlined,
PhoneOutlined,
CheckCircleOutlined,
SyncOutlined,
SendOutlined,
} from '@ant-design/icons';
const { Text } = Typography;
// Dummy data baru untuk user history
const getDummyUsers = (notification) => {
if (!notification) return [];
return [
{
id: '1',
name: 'Budi Santoso',
phone: '081234567890',
status: 'delivered',
},
{
id: '2',
name: 'Citra Lestari',
phone: '082345678901',
status: 'sent',
},
{
id: '3',
name: 'Agus Wijaya',
phone: '083456789012',
status: 'failed',
},
{
id: '4',
name: 'Dewi Anggraini',
phone: '084567890123',
status: 'delivered',
},
];
};
const UserHistoryModal = ({ visible, onCancel, notificationData }) => {
const userData = getDummyUsers(notificationData);
const getStatusTag = (status) => {
switch (status) {
case 'delivered':
return (
} color="success">
Delivered
);
case 'sent':
return (
} color="processing">
Sent
);
case 'failed':
return Failed;
default:
return {status};
}
};
return (
History User Notification
}
open={visible}
onCancel={onCancel}
footer={[
,
]}
width={600}
destroyOnClose
>
{userData.map((user) => (
} />
{getStatusTag(user.status)}
}
onClick={(e) => {
e.stopPropagation();
console.log(`Resend to ${user.name}`);
}}
>
Resend
))}
);
};
export default UserHistoryModal;