mirror of
https://git.vectorsigma.ru/public/tubearchivist.git
synced 2026-08-04 18:19:35 +00:00
Bulk select, #build
Changed: - Added bulk select to table view
This commit is contained in:
@@ -26,12 +26,35 @@ const VideoListItemTable = ({ videoList, viewStyle }: VideoListItemProps) => {
|
|||||||
|
|
||||||
const useSiUnits = userConfig.file_size_unit === FileSizeUnits.Metric;
|
const useSiUnits = userConfig.file_size_unit === FileSizeUnits.Metric;
|
||||||
|
|
||||||
|
let pageIds: string[] = [];
|
||||||
|
if (videoList) {
|
||||||
|
pageIds = videoList.map(video => video.youtube_id);
|
||||||
|
}
|
||||||
|
|
||||||
|
const anySelected = pageIds.some(id => selectedVideoIds.includes(id));
|
||||||
|
|
||||||
|
const handleToggleAllCheck = () => {
|
||||||
|
if (anySelected) {
|
||||||
|
pageIds.forEach(id => removeVideoId(id));
|
||||||
|
} else {
|
||||||
|
pageIds.forEach(id => appendVideoId(id));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`video-item ${viewStyle}`}>
|
<div className={`video-item ${viewStyle}`}>
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
{showSelection && <th />}
|
{showSelection && (
|
||||||
|
<th>
|
||||||
|
<img
|
||||||
|
src={anySelected ? iconChecked : iconUnchecked}
|
||||||
|
className="video-item-select"
|
||||||
|
onClick={handleToggleAllCheck}
|
||||||
|
/>
|
||||||
|
</th>
|
||||||
|
)}
|
||||||
<th>Title</th>
|
<th>Title</th>
|
||||||
<th>Channel</th>
|
<th>Channel</th>
|
||||||
<th>Type</th>
|
<th>Type</th>
|
||||||
|
|||||||
@@ -178,7 +178,8 @@ button:disabled:hover {
|
|||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.video-item.table td img {
|
.video-item.table td img,
|
||||||
|
.video-item.table th img {
|
||||||
width: 20px;
|
width: 20px;
|
||||||
height: 20px;
|
height: 20px;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user