Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | 33x 4003x 4003x 4003x 862x 4003x | import { MerchantData } from "@hooks/enterprise-api/account/types";
import { Box, Stack } from "@mui/material";
import GiveProgressBar from "@shared/ProgressBar/GiveProgressBar";
import GiveText from "@shared/Text/GiveText";
import CircularScore from "@shared/UnderwritingScore/CircularScore";
import { useCustomThemeV2 } from "@theme/hooks/useCustomThemeV2";
import { checkPortals } from "@utils/routing";
import { useMemo } from "react";
export const useKYBColumns = () => {
const { isWideView } = useCustomThemeV2();
const { isEnterpriseTable } = checkPortals();
const kybProgressCol = useMemo(() => {
return {
key: "completedTasksCount,-accID",
sortable: true,
title: "KYB Progress",
columnWidth: !isWideView || isEnterpriseTable ? 1 : 1.7,
columnType: isWideView ? "text" : "empty",
renderColumn: (row: MerchantData) => {
const { completedTasksCount = 0, totalTasksCount = 1 } = row || {};
const percentage = (completedTasksCount * 100) / totalTasksCount;
return (
<Stack
direction="row"
alignItems="center"
justifyContent="space-between"
gap="12px"
>
<GiveText
variant={isWideView ? "bodyS" : "bodyXS"}
color={!totalTasksCount ? "tertiary" : "primary"}
>
{completedTasksCount}/{totalTasksCount}
</GiveText>
<Box width={isWideView ? "115px" : "auto"}>
{isWideView ? (
<GiveProgressBar
value={percentage}
variant={percentage === 100 ? "completed" : "incomplete"}
type="kyb"
/>
) : (
<CircularScore
defaultThreshold={100}
score={percentage}
simple
type="kyb"
/>
)}
</Box>
</Stack>
);
},
};
}, [isWideView, isEnterpriseTable]);
return { kybProgressCol };
};
|