#
vincentlu
2026-01-10 1bc33546a044cbc84dd9595c19dbcd9a4e309fc9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
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;