modify color card by data

This commit is contained in:
2025-10-22 16:11:52 +07:00
parent f52d61da62
commit 98e5ed250c
5 changed files with 34 additions and 8 deletions

View File

@@ -12,11 +12,12 @@ const CardList = ({
showEditModal,
showDeleteDialog,
cardColor,
fieldColor,
}) => {
const getCardStyle = () => {
const color = cardColor ?? '#F3EDEA'; // Orange color
const getCardStyle = (color) => {
const colorStyle = color ?? '#F3EDEA'; // Orange color
return {
border: `2px solid ${color}`,
border: `2px solid ${colorStyle}`,
borderRadius: '8px',
textAlign: 'center', // Center text
};
@@ -47,12 +48,14 @@ const CardList = ({
alignItems: 'center',
}}
>
<span style={getTitleStyle(item.color ?? cardColor)}>
<span
style={getTitleStyle(fieldColor ? item[fieldColor] : cardColor)}
>
{item[header]}
</span>
</div>
}
style={getCardStyle()}
style={getCardStyle(fieldColor ? item[fieldColor] : cardColor)}
actions={[
<EyeOutlined
style={{ color: '#1890ff' }}