@@ -2,11 +2,20 @@ import React from 'react';
22
33import { explode } from '../../libs/strings'
44import shortid from 'shortid' ;
5+ import {
6+ CheckIcon ,
7+ ChevronDoubleDownIcon ,
8+ ArrowPathIcon ,
9+ MinusIcon ,
10+ PlusIcon ,
11+ } from '@heroicons/react/24/outline'
512
613interface Props {
714 modelsData : any ,
815}
916
17+
18+
1019export default function ApiActionEvents ( props : Props ) {
1120 const { modelsData } = props
1221 const { modelsSummary, modelsTimeline } = modelsData
@@ -36,9 +45,18 @@ export default function ApiActionEvents(props: Props) {
3645 < div className = '' dangerouslySetInnerHTML = { { __html : explode ( model . split ( '\\' ) [ model . split ( '\\' ) . length - 1 ] , 30 , "<br/>" ) } } />
3746 </ td >
3847 ) }
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 >
4056 < td >
41- < span className = 'font-bold' > { modelsSummary [ model ] [ event ] } </ span >
57+ < span className = 'font-bold' >
58+ { modelsSummary [ model ] [ event ] }
59+ </ span >
4260 < span className = 'text-slate-400 pl-1' >
4361 Time{ modelsSummary [ model ] [ event ] > 1 ? 's' : '' }
4462 </ span >
@@ -67,7 +85,12 @@ export default function ApiActionEvents(props: Props) {
6785 < div className = { `h-full w-1 bg-${ modelsTimeline [ index ] . event } pointer-events-none` } > </ div >
6886 </ div >
6987 < 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+
7194 </ div >
7295 </ div >
7396 < 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) {
7699 </ h3 >
77100 < p className = "title text-justify w-full" >
78101 < span className = { `badge badge-${ modelsTimeline [ index ] . event } rounded-sm` } >
79- { modelsTimeline [ index ] . event }
102+ { modelsTimeline [ index ] . event }
80103 </ span >
81104 </ p >
82105 </ div >
0 commit comments