@@ -2,11 +2,20 @@ import React from 'react';
2
2
3
3
import { explode } from '../../libs/strings'
4
4
import shortid from 'shortid' ;
5
+ import {
6
+ CheckIcon ,
7
+ ChevronDoubleDownIcon ,
8
+ ArrowPathIcon ,
9
+ MinusIcon ,
10
+ PlusIcon ,
11
+ } from '@heroicons/react/24/outline'
5
12
6
13
interface Props {
7
14
modelsData : any ,
8
15
}
9
16
17
+
18
+
10
19
export default function ApiActionEvents ( props : Props ) {
11
20
const { modelsData } = props
12
21
const { modelsSummary, modelsTimeline } = modelsData
@@ -36,9 +45,18 @@ export default function ApiActionEvents(props: Props) {
36
45
< div className = '' dangerouslySetInnerHTML = { { __html : explode ( model . split ( '\\' ) [ model . split ( '\\' ) . length - 1 ] , 30 , "<br/>" ) } } />
37
46
</ td >
38
47
) }
39
- < td className = 'capitalize' > { event } </ td >
48
+ < td className = 'capitalize' >
49
+ { event == 'created' && < PlusIcon className = { `inline-block w-3 h-3 mr-1` } /> }
50
+ { event == 'saved' && < CheckIcon className = { `inline-block w-3 h-3 mr-1` } /> }
51
+ { event == 'retrieved' && < ChevronDoubleDownIcon className = { `inline-block w-3 h-3 text-white mr-1` } /> }
52
+ { event == 'updated' && < ArrowPathIcon className = { `inline-block w-3 h-3 mr-1` } /> }
53
+ { event == 'deleted' && < MinusIcon className = { `inline-block w-3 h-3 mr-1` } /> }
54
+ { event }
55
+ </ td >
40
56
< td >
41
- < span className = 'font-bold' > { modelsSummary [ model ] [ event ] } </ span >
57
+ < span className = 'font-bold' >
58
+ { modelsSummary [ model ] [ event ] }
59
+ </ span >
42
60
< span className = 'text-slate-400 pl-1' >
43
61
Time{ modelsSummary [ model ] [ event ] > 1 ? 's' : '' }
44
62
</ span >
@@ -67,7 +85,12 @@ export default function ApiActionEvents(props: Props) {
67
85
< div className = { `h-full w-1 bg-${ modelsTimeline [ index ] . event } pointer-events-none` } > </ div >
68
86
</ div >
69
87
< div className = { `w-3 h-3 absolute top-1/2 rounded-full bg-${ modelsTimeline [ index ] . event } shadow text-center` } >
70
- < i className = "fas fa-check-circle text-white" > </ i >
88
+ { modelsTimeline [ index ] . event == 'created' && < PlusIcon className = { `w-3 h-3 text-black mx-auto` } /> }
89
+ { modelsTimeline [ index ] . event == 'saved' && < CheckIcon className = { `w-3 h-3 text-black mx-auto` } /> }
90
+ { modelsTimeline [ index ] . event == 'retrieved' && < ChevronDoubleDownIcon className = { `w-3 h-3 text-white mx-auto` } /> }
91
+ { modelsTimeline [ index ] . event == 'updated' && < ArrowPathIcon className = { `w-3 h-3 text-black mx-auto` } /> }
92
+ { modelsTimeline [ index ] . event == 'deleted' && < MinusIcon className = { `w-3 h-3 text-black mx-auto` } /> }
93
+
71
94
</ div >
72
95
</ div >
73
96
< div className = "col-start-4 col-end-12 rounded-md my-3 mr-auto w-full break-all" >
@@ -76,7 +99,7 @@ export default function ApiActionEvents(props: Props) {
76
99
</ h3 >
77
100
< p className = "title text-justify w-full" >
78
101
< span className = { `badge badge-${ modelsTimeline [ index ] . event } rounded-sm` } >
79
- { modelsTimeline [ index ] . event }
102
+ { modelsTimeline [ index ] . event }
80
103
</ span >
81
104
</ p >
82
105
</ div >
0 commit comments