Web: Values ​​updated in accordance with the response from the method API.

This commit is contained in:
Tatiana Lopaeva 2024-02-20 19:18:34 +03:00
parent 659b06e9a3
commit 704db21ed4
2 changed files with 12 additions and 11 deletions

View File

@ -30,19 +30,20 @@ type TRoomContent = {
export const RoomContent = ({ item, isCurrentPortal }: TRoomContent) => {
const { t } = useTranslation(["Management", "Common", "Settings"]);
const { roomAdminCount, usersCount, roomsCount, usedSize } =
item?.quotaUsage || {
roomAdminCount: null,
usersCount: null,
roomsCount: null,
};
const { customQuota } = item;
const { roomAdminCount, usersCount, roomsCount } = item?.quotaUsage || {
roomAdminCount: null,
usersCount: null,
roomsCount: null,
};
const { quota, usedSize } = item;
const maxStorage = quota && getConvertedSize(t, quota);
const maxStorage = customQuota && getConvertedSize(t, customQuota);
const usedStorage = getConvertedSize(t, usedSize);
const storageSpace =
quota >= 0 ? `${usedStorage}/${maxStorage}` : `${usedStorage}`;
customQuota >= 0 ? `${usedStorage}/${maxStorage}` : `${usedStorage}`;
return (
<StyledRowContent

View File

@ -33,7 +33,7 @@ export type TPortals = {
owner: TOwner;
timeZoneName: string;
quotaUsage: TQuotaUsage;
quota: number;
customQuota: number;
usedSize: number;
};
@ -44,4 +44,4 @@ export type TNewPortalData = {
portalName: string;
};
export type TranslationType = (key: string, opt?: object) => string;
export type TranslationType = (key: string, opt?: object) => string;