fix: remove onRowClick conflict with rowExpansion, clean up imports

This commit is contained in:
Thomas Camlong committed 2026-07-21 16:05:59 +02:00
1 parent fc0da8dedf
commit 9edf6ca99b
3 files changed
+1 -11

No files matched your search

Binary file not shown.

After

Width:  |  Height:  |  Size: 471 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

After

Width:  |  Height:  |  Size: 459 KiB

+1 -11
View File
@@ -3,20 +3,17 @@
import "../widgets-common.css";
import "./styles.css";
import { useCallback, useMemo, useRef, useState } from "react";
import { useCallback, useMemo, useState } from "react";
import {
ActionIcon,
Avatar,
Badge,
Box,
Center,
Divider,
Group,
Menu,
Portal,
Progress,
ScrollArea,
SegmentedControl,
Stack,
Text,
Tooltip,
@@ -24,8 +21,6 @@ import {
} from "@mantine/core";
import { useDisclosure } from "@mantine/hooks";
import {
IconChevronDown,
IconChevronRight,
IconCopy,
IconDownload,
IconFilter,
@@ -36,7 +31,6 @@ import {
IconTrash,
IconTrashX,
IconUpload,
IconX,
} from "@tabler/icons-react";
import dayjs from "dayjs";
import relativeTime from "dayjs/plugin/relativeTime";
@@ -415,9 +409,6 @@ export default function DownloadClientsWidget({
const closeContextMenu = useCallback(() => setContextMenu(null), []);
const toggleExpand = useCallback((id: string) => {
setExpandedIds((prev) => prev.includes(id) ? prev.filter((i) => i !== id) : [...prev, id]);
}, []);
const totalSpeed = clients.reduce((sum, c) => sum + (c.status?.rates.down ?? 0), 0);
const totalUpSpeed = clients.reduce((sum, c) => sum + (c.status?.rates.up ?? 0), 0);
@@ -461,7 +452,6 @@ export default function DownloadClientsWidget({
height="100%"
className="downloads-table"
onRowContextMenu={isEditMode ? undefined : handleContextMenu}
onRowClick={isEditMode ? undefined : ({ record }) => toggleExpand(record.id)}
rowExpansion={{
allowMultiple: true,
expanded: { recordIds: expandedIds, onRecordIdsChange: setExpandedIds },