diff --git a/src/entities/dashboard/payment-data/model/interface.ts b/src/entities/dashboard/payment-data/model/interface.ts index 015402b..6a28eda 100644 --- a/src/entities/dashboard/payment-data/model/interface.ts +++ b/src/entities/dashboard/payment-data/model/interface.ts @@ -2,4 +2,7 @@ export interface IColumnPayments { date: string post: string sum: number + id: number + status: string + type: string } diff --git a/src/entities/dashboard/payment-data/payment-data.ts b/src/entities/dashboard/payment-data/payment-data.ts index 6e72fed..aa659a6 100644 --- a/src/entities/dashboard/payment-data/payment-data.ts +++ b/src/entities/dashboard/payment-data/payment-data.ts @@ -2,7 +2,7 @@ import { TableProps } from 'antd' import { useNotify } from 'app/providers/app' import { IColumnPayments } from 'entities/dashboard/payment-data/model/interface' import { IPostsResponse } from 'entities/settings/posts-table/model/interface' -import { useEffect, useState } from 'react' +import React, { useEffect, useState } from 'react' import { getAxiosInstance } from 'shared/api/api-query/api-query' import { setPaymentsState } from 'shared/redux/dashboard/dashboard-slice' import { useAppDispatch } from 'shared/redux/store' @@ -41,38 +41,5 @@ export const usePaymentData = () => { fetchPosts() }, []) - const columns: TableProps['columns'] = [ - { - title: 'Платеж №', - dataIndex: 'id', - key: 'id', - }, - { - title: 'Статус', - dataIndex: 'status', - key: 'status', - }, - { - title: 'Тип', - dataIndex: 'type', - key: 'type', - }, - { - title: 'Дата', - dataIndex: 'date', - key: 'date', - }, - { - title: 'Пост', - dataIndex: 'post', - key: 'post', - }, - { - title: 'Сумма', - dataIndex: 'sum', - key: 'sum', - }, - ] - - return { fetchData, columns, postSelect } + return { fetchData, postSelect } } diff --git a/src/entities/dashboard/table-data/model/interface.ts b/src/entities/dashboard/table-data/model/interface.ts index 916c1b4..06b8466 100644 --- a/src/entities/dashboard/table-data/model/interface.ts +++ b/src/entities/dashboard/table-data/model/interface.ts @@ -15,4 +15,7 @@ export interface ITablePaymentsState { date: string post: string sum: number + id: number + status: string + type: string } diff --git a/src/pages/dashboard/dashboard.tsx b/src/pages/dashboard/dashboard.tsx index 3aa5795..4c1f294 100644 --- a/src/pages/dashboard/dashboard.tsx +++ b/src/pages/dashboard/dashboard.tsx @@ -1,4 +1,6 @@ +import { TableProps } from 'antd' import { usePaymentData } from 'entities/dashboard/payment-data' +import { IColumnPayments } from 'entities/dashboard/payment-data/model/interface' import { useTableData } from 'entities/dashboard/table-data' import { DashboardCharts } from 'pages/dashboard/ui/dashboard-charts' import { DashboardFilters } from 'pages/dashboard/ui/dashboard-filters' @@ -6,8 +8,53 @@ import { DashboardPayment } from 'pages/dashboard/ui/dashboard-payment' import React, { FC } from 'react' export const Dashboard: FC = () => { - const { fetchData, columns, postSelect } = usePaymentData() + const { fetchData, postSelect } = usePaymentData() const { paymentTable, paymentTableSum, totalPaymentTable } = useTableData() + const columns: TableProps['columns'] = [ + { + title: 'Платеж №', + dataIndex: 'id', + key: 'id', + }, + { + title: 'Статус', + dataIndex: 'status', + key: 'status', + }, + { + title: 'Тип', + dataIndex: 'type', + key: 'type', + }, + { + title: 'Дата', + dataIndex: 'date', + key: 'date', + }, + { + title: 'Пост', + dataIndex: 'post', + key: 'post', + }, + { + title: 'Сумма', + dataIndex: 'sum', + key: 'sum', + }, + { + title: 'Qr-код', + key: 'qr', + render: (_, record) => ( + + Показать + + ), + }, + ] return ( <>