@@ -15,6 +15,7 @@ import { Item, ItemField, ItemsList } from "../components/ItemsList";
15
15
import moment from "moment" ;
16
16
import Pagination from "../components/Pagination" ;
17
17
import Header from "../components/Header" ;
18
+ import creditsSvg from "../images/credits.svg" ;
18
19
19
20
function TeamUsage ( ) {
20
21
const { teams } = useContext ( TeamsContext ) ;
@@ -48,7 +49,9 @@ function TeamUsage() {
48
49
} ;
49
50
50
51
const getMinutes = ( endTime : number , startTime : number ) => {
51
- return Math . floor ( endTime - startTime ) / ( 1000 * 60 ) + " min" ;
52
+ const lengthOfUsage = Math . floor ( endTime - startTime ) ;
53
+ const inMinutes = ( lengthOfUsage / ( 1000 * 60 ) ) . toFixed ( 1 ) ;
54
+ return inMinutes + " min" ;
52
55
} ;
53
56
54
57
const calculateTotalUsage = ( ) => {
@@ -68,15 +71,16 @@ function TeamUsage() {
68
71
< div className = "app-container" >
69
72
< div className = "flex space-x-16" >
70
73
< div className = "flex" >
71
- < div className = "space-y-8 mt-6 mb-6" >
74
+ < div className = "space-y-8 mt-6 mb-6" style = { { width : "max-content" } } >
72
75
< div className = "flex flex-col truncate" >
73
76
< div className = "text-base text-gray-500 truncate" > Period</ div >
74
- < div className = "mr-3 text-lg text-gray-600 font-semibold truncate" > June 2022</ div >
77
+ < div className = "text-lg text-gray-600 font-semibold truncate" > June 2022</ div >
75
78
</ div >
76
79
< div className = "flex flex-col truncate" >
77
- < div className = "text-base text-gray-500 truncate" > Monthly usage</ div >
78
- < div className = "mr-3 text-lg text-gray-600 font-semibold truncate" >
79
- { calculateTotalUsage ( ) } Total Credits
80
+ < div className = "text-base text-gray-500" > Monthly usage</ div >
81
+ < div className = "flex text-lg text-gray-600 font-semibold" >
82
+ < img className = "mr-1" src = { creditsSvg } alt = { "credits icon" } />
83
+ < span > { calculateTotalUsage ( ) } Total Credits</ span >
80
84
</ div >
81
85
</ div >
82
86
</ div >
@@ -95,7 +99,8 @@ function TeamUsage() {
95
99
< ItemField className = "my-auto" >
96
100
< span > Usage</ span >
97
101
</ ItemField >
98
- < ItemField className = "my-auto" >
102
+ < ItemField className = "flex my-auto space-x-1" >
103
+ < img src = { creditsSvg } alt = { "credits icon" } />
99
104
< span > Credits</ span >
100
105
</ ItemField >
101
106
< ItemField className = "my-auto" />
0 commit comments