diff --git a/frontend/src/components/tables/ChannelTableStreams.jsx b/frontend/src/components/tables/ChannelTableStreams.jsx
index c682705a..dae9d2da 100644
--- a/frontend/src/components/tables/ChannelTableStreams.jsx
+++ b/frontend/src/components/tables/ChannelTableStreams.jsx
@@ -23,6 +23,7 @@ import {
MouseSensor,
TouchSensor,
closestCenter,
+ useDraggable,
useSensor,
useSensors,
} from '@dnd-kit/core';
@@ -36,19 +37,22 @@ import { useSortable } from '@dnd-kit/sortable';
import { CSS } from '@dnd-kit/utilities';
import { shallow } from 'zustand/shallow';
-// Cell Component
const RowDragHandleCell = ({ rowId }) => {
- const { attributes, listeners } = useSortable({
+ const { attributes, listeners, setNodeRef } = useDraggable({
id: rowId,
});
+
return (
- // Alternatively, you could set these attributes on the rows themselves
@@ -57,7 +61,7 @@ const RowDragHandleCell = ({ rowId }) => {
};
// Row Component
-const DraggableRow = ({ row }) => {
+const DraggableRow = ({ row, index }) => {
const { transform, transition, setNodeRef, isDragging } = useSortable({
id: row.original.id,
});
@@ -73,7 +77,7 @@ const DraggableRow = ({ row }) => {
{
enableRowSelection: true,
getRowId: (row) => row.id,
getCoreRowModel: getCoreRowModel(),
- // getFilteredRowModel: getFilteredRowModel(),
- // getSortedRowModel: getSortedRowModel(),
- // getPaginationRowModel: getPaginationRowModel(),
});
function handleDragEnd(event) {
diff --git a/frontend/src/components/tables/ChannelsTable.jsx b/frontend/src/components/tables/ChannelsTable.jsx
index 15dc34c9..d395adee 100644
--- a/frontend/src/components/tables/ChannelsTable.jsx
+++ b/frontend/src/components/tables/ChannelsTable.jsx
@@ -31,8 +31,6 @@ import {
ArrowUpNarrowWide,
ArrowUpDown,
ArrowDownWideNarrow,
- ChevronDown,
- ChevronRight,
} from 'lucide-react';
import ghostImage from '../../images/ghost.svg';
import {
@@ -54,7 +52,6 @@ import {
MultiSelect,
Pagination,
NativeSelect,
- Checkbox,
UnstyledButton,
CopyButton,
} from '@mantine/core';
@@ -254,7 +251,6 @@ const ChannelRowActions = React.memo(
const ChannelsTable = ({}) => {
const data = useChannelsTableStore((s) => s.channels);
- const rowCount = useChannelsTableStore((s) => s.count);
const pageCount = useChannelsTableStore((s) => s.pageCount);
const setSelectedTableIds = useChannelsTableStore(
(s) => s.setSelectedChannelIds
@@ -710,7 +706,9 @@ const ChannelsTable = ({}) => {
},
{
accessorFn: (row) =>
- row.channel_group_id ? channelGroups[row.channel_group_id].name : '',
+ row.channel_group_id && channelGroups
+ ? channelGroups[row.channel_group_id].name
+ : '',
id: 'channel_group',
cell: ({ getValue }) => (
{
},
});
- const onRowExpansion = (row) => {
- let isExpanded = false;
- setExpandedRowIds((prev) => {
- isExpanded = prev === row.original.id ? null : row.original.id;
- return isExpanded;
- });
- setRowSelection({ [row.index]: true });
- setSelectedChannelIds([row.original.id]);
- setSelectedTableIds([row.original.id]);
- };
-
- // const renderBodyCell = (cell) => {
- // switch (cell.column.id) {
- // case 'select':
- // return ChannelRowSelectCell({ row: cell.row });
-
- // case 'expand':
- // return ChannelExpandCell({ row: cell.row });
-
- // default:
- // return flexRender(cell.column.columnDef.cell, cell.getContext());
- // }
- // };
-
- const ChannelExpandCell = useCallback(
- ({ row }) => {
- const isExpanded = expandedRowIds === row.original.id;
-
- return (
- {
- onRowExpansion(row);
- }}
- >
- {isExpanded ? : }
-
- );
- },
- [expandedRowIds]
- );
-
- // const ChannelRowSelectCell = useCallback(
- // ({ row }) => {
- // return (
- //
- //
- //
- // );
- // },
- // [rows]
- // );
-
- // const ChannelRowSelectHeader = useCallback(
- // ({ selectedChannelIds }) => {
- // return (
- //
- // 0 &&
- // selectedChannelIds.length !== rowCount
- // }
- // onChange={onSelectAllChange}
- // />
- //
- // );
- // },
- // [rows]
- // );
-
return (
{/* Header Row: outside the Paper */}
@@ -1123,6 +1043,7 @@ const ChannelsTable = ({}) => {