@@ -14,6 +14,8 @@ import MRTDataTable from "@flanksource-ui/ui/MRTDataTable/MRTDataTable";
14
14
import { Menu , MenuButton , MenuItem , MenuItems } from "@headlessui/react" ;
15
15
import { DotsVerticalIcon } from "@heroicons/react/solid" ;
16
16
import { useMutation , useQuery , useQueryClient } from "@tanstack/react-query" ;
17
+ import clsx from "clsx" ;
18
+ import dayjs from "dayjs" ;
17
19
import { MRT_ColumnDef } from "mantine-react-table" ;
18
20
import { useState } from "react" ;
19
21
import { BiRepeat } from "react-icons/bi" ;
@@ -120,13 +122,18 @@ const silenceNotificationListColumns: MRT_ColumnDef<NotificationSilenceItemApiRe
120
122
const component = row . original . component ;
121
123
const recursive = row . original . recursive ;
122
124
125
+ const isExpired = dayjs ( row . original . until ) . isBefore ( dayjs ( ) ) ;
126
+
123
127
return (
124
128
< div
125
129
onClick = { ( e ) => {
126
130
e . stopPropagation ( ) ;
127
131
e . preventDefault ( ) ;
128
132
} }
129
- className = "flex flex-row items-center"
133
+ className = { clsx (
134
+ "flex flex-row items-center" ,
135
+ isExpired && "line-through"
136
+ ) }
130
137
>
131
138
{ check && (
132
139
< CheckLink
@@ -157,19 +164,41 @@ const silenceNotificationListColumns: MRT_ColumnDef<NotificationSilenceItemApiRe
157
164
Cell : ( { row } ) => {
158
165
const from = row . original . from ;
159
166
const until = row . original . until ;
167
+ const isExpired = dayjs ( until ) . isBefore ( dayjs ( ) ) ;
160
168
161
- return < Age from = { from } to = { until } /> ;
169
+ return (
170
+ < Age
171
+ className = { clsx ( isExpired && "line-through" ) }
172
+ from = { from }
173
+ to = { until }
174
+ />
175
+ ) ;
162
176
}
163
177
} ,
164
178
{
165
179
header : "Source" ,
166
180
accessorKey : "source" ,
167
- size : 100
181
+ size : 100 ,
182
+ Cell : ( { row } ) => {
183
+ const source = row . original . source ;
184
+ const isExpired = dayjs ( row . original . until ) . isBefore ( dayjs ( ) ) ;
185
+ return (
186
+ < span className = { clsx ( isExpired && "line-through" ) } > { source } </ span >
187
+ ) ;
188
+ }
168
189
} ,
169
190
{
170
191
header : "Reason" ,
171
192
accessorKey : "description" ,
172
- size : 400
193
+ size : 400 ,
194
+ Cell : ( { row } ) => {
195
+ const isExpired = dayjs ( row . original . until ) . isBefore ( dayjs ( ) ) ;
196
+ return (
197
+ < span className = { clsx ( isExpired && "line-through" ) } >
198
+ { row . original . description }
199
+ </ span >
200
+ ) ;
201
+ }
173
202
} ,
174
203
{
175
204
header : "Created By" ,
0 commit comments