hidden total score from transaction and installtion report

This commit is contained in:
hamid zarghami
2025-12-03 15:16:52 +03:30
parent 3173def1d9
commit 14e405ae4d
3 changed files with 10 additions and 7 deletions
+8 -5
View File
@@ -14,7 +14,8 @@ type Props = {
isLoading?: boolean, isLoading?: boolean,
totalData?: number, totalData?: number,
tableScore?: number, tableScore?: number,
totalScore?: number totalScore?: number,
showTotalScore?: boolean
} }
type ADSortType = { type ADSortType = {
@@ -22,7 +23,7 @@ type ADSortType = {
value: 1 | -1 value: 1 | -1
} }
export const Table: FC<Props> = ({ columns, data, tableStatus = false, tableScore = 0, isLoading = false, totalData = 0, totalScore = 0 }) => { export const Table: FC<Props> = ({ columns, data, tableStatus = false, tableScore = 0, isLoading = false, totalData = 0, totalScore = 0, showTotalScore = true }) => {
const [aDSort, setADSort] = useState<ADSortType>({ const [aDSort, setADSort] = useState<ADSortType>({
key: "", key: "",
value: -1 value: -1
@@ -81,9 +82,11 @@ export const Table: FC<Props> = ({ columns, data, tableStatus = false, tableScor
<div> <div>
{tableStatus && `امتیاز حال حاضر : ${tableScore}`} {tableStatus && `امتیاز حال حاضر : ${tableScore}`}
</div> </div>
<div> {showTotalScore && (
{`امتیاز کل : ${totalScore}`} <div>
</div> {`امتیاز کل : ${totalScore}`}
</div>
)}
</div> </div>
<div className="block max-w-full min-h-max overflow-x-auto overflow-y-hidden bg-auth-form rounded-[40px] shadow-sm p-4 pb-0 xl:p-9 xl:pb-0 relative"> <div className="block max-w-full min-h-max overflow-x-auto overflow-y-hidden bg-auth-form rounded-[40px] shadow-sm p-4 pb-0 xl:p-9 xl:pb-0 relative">
<table> <table>
@@ -33,6 +33,6 @@ export const InstallationReports = () => {
}) })
}, [mutate, params]) }, [mutate, params])
return ( return (
<Table columns={installationReportsCol} data={data?.data} totalData={data?.total} isLoading={isPending} /> <Table columns={installationReportsCol} data={data?.data} totalData={data?.total} isLoading={isPending} showTotalScore={false} />
) )
} }
+1 -1
View File
@@ -33,6 +33,6 @@ export const Transactions = () => {
}) })
}, [mutate, params]) }, [mutate, params])
return ( return (
<Table columns={transactionsCol} data={data?.data} isLoading={isPending} totalData={data?.total} /> <Table columns={transactionsCol} data={data?.data} isLoading={isPending} totalData={data?.total} showTotalScore={false} />
) )
} }