index.jsx 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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.js';
  17. import ChannelsTable from './ChannelsTable.jsx';
  18. import ChannelsActions from './ChannelsActions.jsx';
  19. import ChannelsFilters from './ChannelsFilters.jsx';
  20. import ChannelsTabs from './ChannelsTabs.jsx';
  21. import { useChannelsData } from '../../../hooks/channels/useChannelsData.js';
  22. import { useIsMobile } from '../../../hooks/common/useIsMobile.js';
  23. import BatchTagModal from './modals/BatchTagModal.jsx';
  24. import ModelTestModal from './modals/ModelTestModal.jsx';
  25. import ColumnSelectorModal from './modals/ColumnSelectorModal.jsx';
  26. import EditChannelModal from './modals/EditChannelModal.jsx';
  27. import EditTagModal from './modals/EditTagModal.jsx';
  28. import { createCardProPagination } from '../../../helpers/utils';
  29. const ChannelsPage = () => {
  30. const channelsData = useChannelsData();
  31. const isMobile = useIsMobile();
  32. return (
  33. <>
  34. {/* Modals */}
  35. <ColumnSelectorModal {...channelsData} />
  36. <EditTagModal
  37. visible={channelsData.showEditTag}
  38. tag={channelsData.editingTag}
  39. handleClose={() => channelsData.setShowEditTag(false)}
  40. refresh={channelsData.refresh}
  41. />
  42. <EditChannelModal
  43. refresh={channelsData.refresh}
  44. visible={channelsData.showEdit}
  45. handleClose={channelsData.closeEdit}
  46. editingChannel={channelsData.editingChannel}
  47. />
  48. <BatchTagModal {...channelsData} />
  49. <ModelTestModal {...channelsData} />
  50. {/* Main Content */}
  51. <CardPro
  52. type="type3"
  53. tabsArea={<ChannelsTabs {...channelsData} />}
  54. actionsArea={<ChannelsActions {...channelsData} />}
  55. searchArea={<ChannelsFilters {...channelsData} />}
  56. paginationArea={createCardProPagination({
  57. currentPage: channelsData.activePage,
  58. pageSize: channelsData.pageSize,
  59. total: channelsData.channelCount,
  60. onPageChange: channelsData.handlePageChange,
  61. onPageSizeChange: channelsData.handlePageSizeChange,
  62. isMobile: isMobile,
  63. })}
  64. t={channelsData.t}
  65. >
  66. <ChannelsTable {...channelsData} />
  67. </CardPro>
  68. </>
  69. );
  70. };
  71. export default ChannelsPage;