fix: let mantine-datatable manage row expansion state internally
This commit is contained in:
2 files changed
+15
-2
No files matched your search
@@ -25,6 +25,21 @@ import { downloadsWidget } from '.';
|
|||||||
|
|
||||||
This widget displays a list of torrents or usenet-articles that are currently being downloaded, along with their progress and other relevant information. It supports 7 download client integrations and provides a rich, responsive table interface.
|
This widget displays a list of torrents or usenet-articles that are currently being downloaded, along with their progress and other relevant information. It supports 7 download client integrations and provides a rich, responsive table interface.
|
||||||
|
|
||||||
|
### Screenshots
|
||||||
|
|
||||||
|
import downloadsCard from './img/screenshot.png';
|
||||||
|
import contextMenuImg from './img/context-menu.png';
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<img src={downloadsCard} alt="Downloads widget showing torrent and usenet items" width={128 * 4} />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
#### Right-click context menu
|
||||||
|
|
||||||
|
<div>
|
||||||
|
<img src={contextMenuImg} alt="Downloads widget context menu with pause, delete, and copy actions" width={128 * 4} />
|
||||||
|
</div>
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
- **Responsive table** — columns automatically adapt to widget width, hiding less important columns at smaller sizes
|
- **Responsive table** — columns automatically adapt to widget width, hiding less important columns at smaller sizes
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ export default function DownloadClientsWidget({
|
|||||||
|
|
||||||
const [clientFilter, setClientFilter] = useState<string[]>([]);
|
const [clientFilter, setClientFilter] = useState<string[]>([]);
|
||||||
const [statusFilter, setStatusFilter] = useState<string[]>([]);
|
const [statusFilter, setStatusFilter] = useState<string[]>([]);
|
||||||
const [expandedIds, setExpandedIds] = useState<string[]>([]);
|
|
||||||
const [contextMenu, setContextMenu] = useState<ContextMenuState | null>(null);
|
const [contextMenu, setContextMenu] = useState<ContextMenuState | null>(null);
|
||||||
|
|
||||||
const utils = clientApi.useUtils();
|
const utils = clientApi.useUtils();
|
||||||
@@ -454,7 +453,6 @@ export default function DownloadClientsWidget({
|
|||||||
onRowContextMenu={isEditMode ? undefined : handleContextMenu}
|
onRowContextMenu={isEditMode ? undefined : handleContextMenu}
|
||||||
rowExpansion={{
|
rowExpansion={{
|
||||||
allowMultiple: true,
|
allowMultiple: true,
|
||||||
expanded: { recordIds: expandedIds, onRecordIdsChange: setExpandedIds },
|
|
||||||
content: ({ record }) => <ExpandedRow item={record} />,
|
content: ({ record }) => <ExpandedRow item={record} />,
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|||||||
Reference in new issue
Block a user