index.jsx 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*
  2. Copyright (C) 2025 QuantumNous
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU Affero General Public License as
  5. published by the Free Software Foundation, either version 3 of the
  6. License, or (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU Affero General Public License for more details.
  11. You should have received a copy of the GNU Affero General Public License
  12. along with this program. If not, see <https://www.gnu.org/licenses/>.
  13. For commercial licensing, please contact support@quantumnous.com
  14. */
  15. import React from 'react';
  16. import CardPro from '../../common/ui/CardPro';
  17. import LogsTable from './UsageLogsTable';
  18. import LogsActions from './UsageLogsActions';
  19. import LogsFilters from './UsageLogsFilters';
  20. import ColumnSelectorModal from './modals/ColumnSelectorModal';
  21. import UserInfoModal from './modals/UserInfoModal';
  22. import ChannelAffinityUsageCacheModal from './modals/ChannelAffinityUsageCacheModal';
  23. import { useLogsData } from '../../../hooks/usage-logs/useUsageLogsData';
  24. import { useIsMobile } from '../../../hooks/common/useIsMobile';
  25. import { createCardProPagination } from '../../../helpers/utils';
  26. const LogsPage = () => {
  27. const logsData = useLogsData();
  28. const isMobile = useIsMobile();
  29. return (
  30. <>
  31. {/* Modals */}
  32. <ColumnSelectorModal {...logsData} />
  33. <UserInfoModal {...logsData} />
  34. <ChannelAffinityUsageCacheModal {...logsData} />
  35. {/* Main Content */}
  36. <CardPro
  37. type='type2'
  38. statsArea={<LogsActions {...logsData} />}
  39. searchArea={<LogsFilters {...logsData} />}
  40. paginationArea={createCardProPagination({
  41. currentPage: logsData.activePage,
  42. pageSize: logsData.pageSize,
  43. total: logsData.logCount,
  44. onPageChange: logsData.handlePageChange,
  45. onPageSizeChange: logsData.handlePageSizeChange,
  46. isMobile: isMobile,
  47. t: logsData.t,
  48. })}
  49. t={logsData.t}
  50. >
  51. <LogsTable {...logsData} />
  52. </CardPro>
  53. </>
  54. );
  55. };
  56. export default LogsPage;