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