@@ -10,15 +10,15 @@ import {
10
10
IconCheck , IconEye , IconHourglassEmpty , IconPrinter , IconRefresh , IconX ,
11
11
} from '@tabler/icons-react' ;
12
12
13
- function PrintTaskRow ( { task, refresh } ) {
13
+ function PrintTaskRow ( { colorCode , task, refresh } ) {
14
14
const [ loading , setLoading ] = React . useState ( false ) ;
15
15
16
16
const codeActions = async ( _id , operation ) => {
17
17
setLoading ( true ) ;
18
18
const post = ( ) => fetch ( '/print' , {
19
19
method : 'POST' ,
20
20
headers : { 'Content-Type' : 'application/json' } ,
21
- body : JSON . stringify ( { _id, operation } ) ,
21
+ body : JSON . stringify ( { _id, operation, color : colorCode } ) ,
22
22
} ) ;
23
23
if ( operation === 'view' ) {
24
24
const pdf = await ( await post ( ) ) . blob ( ) ;
@@ -93,7 +93,7 @@ function PrintTaskRow({ task, refresh }) {
93
93
) ;
94
94
}
95
95
96
- export function PrintTasksTable ( { codes, refresh } ) {
96
+ export function PrintTasksTable ( { colorCode , codes, refresh } ) {
97
97
return (
98
98
< Table
99
99
horizontalSpacing = "md" verticalSpacing = "xs" miw = { 700 }
@@ -108,7 +108,7 @@ export function PrintTasksTable({ codes, refresh }) {
108
108
< Table . Th > Actions</ Table . Th >
109
109
</ Table . Tr >
110
110
</ Table . Thead >
111
- < Table . Tbody > { codes . map ( ( task ) => < PrintTaskRow key = { task . _id } task = { task } refresh = { refresh } /> ) } </ Table . Tbody >
111
+ < Table . Tbody > { codes . map ( ( task ) => < PrintTaskRow key = { task . _id } task = { task } colorCode = { colorCode } refresh = { refresh } /> ) } </ Table . Tbody >
112
112
</ Table >
113
113
) ;
114
114
}
0 commit comments