Skip to content

Commit b21b73c

Browse files
author
Laurie T. Malau
committed
addd
1 parent b75714b commit b21b73c

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed
Lines changed: 1 addition & 0 deletions
Loading

components/dashboard/src/teams/TeamUsage.tsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { Item, ItemField, ItemsList } from "../components/ItemsList";
1515
import moment from "moment";
1616
import Pagination from "../components/Pagination";
1717
import Header from "../components/Header";
18+
import creditsSvg from "../images/credits.svg";
1819

1920
function TeamUsage() {
2021
const { teams } = useContext(TeamsContext);
@@ -48,7 +49,9 @@ function TeamUsage() {
4849
};
4950

5051
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";
5255
};
5356

5457
const calculateTotalUsage = () => {
@@ -68,15 +71,16 @@ function TeamUsage() {
6871
<div className="app-container">
6972
<div className="flex space-x-16">
7073
<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" }}>
7275
<div className="flex flex-col truncate">
7376
<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>
7578
</div>
7679
<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>
8084
</div>
8185
</div>
8286
</div>
@@ -95,7 +99,8 @@ function TeamUsage() {
9599
<ItemField className="my-auto">
96100
<span>Usage</span>
97101
</ItemField>
98-
<ItemField className="my-auto">
102+
<ItemField className="flex my-auto space-x-1">
103+
<img src={creditsSvg} alt={"credits icon"} />
99104
<span>Credits</span>
100105
</ItemField>
101106
<ItemField className="my-auto" />

0 commit comments

Comments
 (0)