import deepPurple from '@mui/material/colors/deepPurple';
|
import teal from '@mui/material/colors/teal';
|
import lightBlue from '@mui/material/colors/lightBlue';
|
import blue from '@mui/material/colors/blue';
|
import grey from '@mui/material/colors/grey';
|
|
const rowSx = (selectedRow) => (record) => {
|
let style = {};
|
if (!record) {
|
return style;
|
}
|
if (selectedRow && selectedRow.id === record.id) {
|
style = {
|
...style,
|
backgroundColor: 'action.selected',
|
};
|
}
|
if (record.type === 'IN')
|
return {
|
...style,
|
borderLeftColor: teal[500],
|
borderLeftWidth: 5,
|
borderLeftStyle: 'solid',
|
};
|
if (record.type === 'OUT')
|
return {
|
...style,
|
borderLeftColor: lightBlue[500],
|
borderLeftWidth: 5,
|
borderLeftStyle: 'solid',
|
};
|
if (record.statusBool)
|
return {
|
...style,
|
borderLeftColor: grey[500],
|
borderLeftWidth: 5,
|
borderLeftStyle: 'solid',
|
};
|
return style;
|
};
|
|
export default rowSx;
|