1
- import { makeStyles } from "@mui/styles" ;
2
- import TableRow , { TableRowProps } from "@mui/material/TableRow" ;
1
+ import TableRow , { type TableRowProps } from "@mui/material/TableRow" ;
3
2
import { type PropsWithChildren , forwardRef } from "react" ;
4
- import { combineClasses } from "utils/combineClasses" ;
5
3
6
4
type TimelineEntryProps = PropsWithChildren <
7
5
TableRowProps & {
@@ -13,47 +11,39 @@ export const TimelineEntry = forwardRef(function TimelineEntry(
13
11
{ children, clickable = true , ...props } : TimelineEntryProps ,
14
12
ref ?: React . ForwardedRef < HTMLTableRowElement > ,
15
13
) {
16
- const styles = useStyles ( ) ;
17
-
18
14
return (
19
15
< TableRow
20
16
ref = { ref }
21
- className = { combineClasses ( {
22
- [ styles . timelineEntry ] : true ,
23
- [ styles . clickable ] : clickable ,
24
- } ) }
17
+ css = { ( theme ) => [
18
+ {
19
+ position : "relative" ,
20
+ "&:focus" : {
21
+ outlineStyle : "solid" ,
22
+ outlineOffset : - 1 ,
23
+ outlineWidth : 2 ,
24
+ outlineColor : theme . palette . secondary . dark ,
25
+ } ,
26
+ "& td:before" : {
27
+ position : "absolute" ,
28
+ left : 50 ,
29
+ display : "block" ,
30
+ content : "''" ,
31
+ height : "100%" ,
32
+ width : 2 ,
33
+ background : theme . palette . divider ,
34
+ } ,
35
+ } ,
36
+ clickable && {
37
+ cursor : "pointer" ,
38
+
39
+ "&:hover" : {
40
+ backgroundColor : theme . palette . action . hover ,
41
+ } ,
42
+ } ,
43
+ ] }
25
44
{ ...props }
26
45
>
27
46
{ children }
28
47
</ TableRow >
29
48
) ;
30
49
} ) ;
31
-
32
- const useStyles = makeStyles ( ( theme ) => ( {
33
- clickable : {
34
- cursor : "pointer" ,
35
-
36
- "&:hover" : {
37
- backgroundColor : theme . palette . action . hover ,
38
- } ,
39
- } ,
40
-
41
- timelineEntry : {
42
- position : "relative" ,
43
- "&:focus" : {
44
- outlineStyle : "solid" ,
45
- outlineOffset : - 1 ,
46
- outlineWidth : 2 ,
47
- outlineColor : theme . palette . secondary . dark ,
48
- } ,
49
- "& td:before" : {
50
- position : "absolute" ,
51
- left : 50 ,
52
- display : "block" ,
53
- content : "''" ,
54
- height : "100%" ,
55
- width : 2 ,
56
- background : theme . palette . divider ,
57
- } ,
58
- } ,
59
- } ) ) ;
0 commit comments