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 | 33x 3868x 3868x 843x 3868x | import { MerchantData } from "@hooks/enterprise-api/account/types";
import { Box } from "@mui/material";
import { 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 { useMemo } from "react";
export const usePendingColumns = () => {
const { isWideView } = useCustomThemeV2();
const pendingProgressCol = useMemo(() => {
return {
key: "completedStepsCount,-accID",
sortable: true,
title: "Progress",
columnWidth: !isWideView ? 1 : 1.2,
columnType: isWideView ? "text" : "empty",
renderColumn: (row: MerchantData) => {
const { completedStepsCount = 0, totalStepsCount = 1 } = row || {};
const percentage = (completedStepsCount * 100) / totalStepsCount;
return (
<Stack
direction="row"
alignItems="center"
justifyContent="space-between"
gap="12px"
>
<GiveText
variant={isWideView ? "bodyS" : "bodyXS"}
color={!totalStepsCount ? "tertiary" : "primary"}
>
{completedStepsCount}/{totalStepsCount}
</GiveText>
<Box width={isWideView ? "115px" : "auto"}>
{isWideView ? (
<GiveProgressBar
value={percentage}
variant={percentage === 100 ? "completed" : "incomplete"}
type="onboarding"
/>
) : (
<CircularScore
defaultThreshold={100}
score={percentage}
simple
type="onboarding"
/>
)}
</Box>
</Stack>
);
},
};
}, [isWideView]);
return { pendingProgressCol };
};
|