Skip to content

Commit

Permalink
feat: calculate remaining value in license details
Browse files Browse the repository at this point in the history
  • Loading branch information
sergivalero20 committed Aug 20, 2024
1 parent 80ad2cb commit 660d4e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/features/Licenses/LicensesDetailPage/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ const LicensesDetailPage = () => {
const licenseTable = useSelector((state) => state.licenses.table);
const licenseInfo = licenseTable.data
.find((license) => license?.licenseId === parseInt(licenseId, 10)) || defaultLicenseInfo;

const isLoadingCourses = coursesTable.table.status === RequestStatus.LOADING;
const isLoadingLicenses = licenseTable.status === RequestStatus.LOADING;

Expand Down Expand Up @@ -110,8 +111,8 @@ const LicensesDetailPage = () => {
<div className="separator mx-4" />
<div className="d-flex flex-column align-items-center">
<p className="title">Remaining</p>
<span className="value number-of-pending">
{licenseInfo.numberOfPendingStudents}
<span className="value number-of-remaining">
{licenseInfo.purchasedSeats - licenseInfo.numberOfStudents - licenseInfo.numberOfPendingStudents}
</span>
</div>
</>
Expand Down
2 changes: 1 addition & 1 deletion src/features/Licenses/LicensesDetailPage/index.scss
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
font-weight: bold;
}

.number-of-pending {
.number-of-remaining {
color: red;
}

Expand Down

0 comments on commit 660d4e3

Please sign in to comment.