From 9fc1c7cb406c075d423e8da5f758531465262e96 Mon Sep 17 00:00:00 2001 From: Iqbal Rizqi Kurniawan Date: Tue, 14 Oct 2025 19:06:23 +0700 Subject: [PATCH] feat: implement card view for device listing with actions for preview, edit, and delete --- .../master/device/component/CardDevice.jsx | 84 +++++++++++++++++++ .../master/device/component/ListDevice.jsx | 75 ++++++++++------- 2 files changed, 131 insertions(+), 28 deletions(-) create mode 100644 src/pages/master/device/component/CardDevice.jsx diff --git a/src/pages/master/device/component/CardDevice.jsx b/src/pages/master/device/component/CardDevice.jsx new file mode 100644 index 0000000..eb2ad74 --- /dev/null +++ b/src/pages/master/device/component/CardDevice.jsx @@ -0,0 +1,84 @@ +import React from 'react'; +import { Card, Button, Row, Col, Typography, Space, Tag } from 'antd'; +import { EditOutlined, DeleteOutlined, EyeOutlined } from '@ant-design/icons'; + +const { Text } = Typography; + +const CardDevice = ({ data, showPreviewModal, showEditModal, showDeleteDialog }) => { + const getCardStyle = () => { + const color = '#FF8C42'; // Orange color + return { + border: `2px solid ${color}`, + borderRadius: '8px', + textAlign: 'center' // Center text + }; + }; + + const getTitleStyle = () => { + const backgroundColor = '#FF8C42'; // Orange color + return { + backgroundColor, + color: '#fff', + padding: '2px 8px', + borderRadius: '4px', + display: 'inline-block', + }; + }; + + return ( + + {data.map((item) => ( + + + {item.device_name} + + } + style={getCardStyle()} + actions={[ + +