fix dual action

This commit is contained in:
2025-11-24 15:57:12 +07:00
parent 908788f41d
commit 1cd9cf765c

View File

@@ -58,34 +58,34 @@ const CardList = ({
style={getCardStyle(fieldColor ? item[fieldColor] : cardColor)} style={getCardStyle(fieldColor ? item[fieldColor] : cardColor)}
actions={[ actions={[
showPreviewModal && ( showPreviewModal && (
<EyeOutlined <EyeOutlined
style={{ color: '#1890ff' }} style={{ color: '#1890ff' }}
key="preview" key="preview"
onClick={() => showPreviewModal(item)} onClick={() => showPreviewModal(item)}
/> />
), ),
showEditModal && ( showEditModal && (
<EditOutlined <EditOutlined
style={{ color: '#faad14' }} style={{ color: '#faad14' }}
key="edit" key="edit"
onClick={() => showEditModal(item)} onClick={() => showEditModal(item)}
/> />
), ),
showDeleteDialog && ( showDeleteDialog && (
<DeleteOutlined <DeleteOutlined
style={{ color: '#ff1818' }} style={{ color: '#ff1818' }}
key="delete" key="delete"
onClick={() => showDeleteDialog(item)} onClick={() => showDeleteDialog(item)}
/> />
), ),
].filter(Boolean)} // <== Hapus elemen yang undefined ].filter(Boolean)} // <== Hapus elemen yang undefined
> >
<div style={{ textAlign: 'left' }}> <div style={{ textAlign: 'left' }}>
{column.map((itemCard, index) => ( {column.map((itemCard, index) => (
<React.Fragment key={index}> <React.Fragment key={index}>
{!itemCard.hidden && {!itemCard.hidden &&
itemCard.title !== 'No' && itemCard.title !== 'No' &&
itemCard.title !== 'Aksi' && ( itemCard.title !== 'Action' && (
<p style={{ margin: '8px 0' }}> <p style={{ margin: '8px 0' }}>
<Text strong>{itemCard.title}:</Text>{' '} <Text strong>{itemCard.title}:</Text>{' '}
{itemCard.render {itemCard.render