diff --git a/.vscode/settings.json b/.vscode/settings.json
index 042ffd324..df5fe0a2f 100644
--- a/.vscode/settings.json
+++ b/.vscode/settings.json
@@ -148,6 +148,7 @@
"whitespaces",
"winrate",
"wireframe",
+ "Woah",
"WOTB",
"wotblitz",
"xffn",
diff --git a/src/app/tools/compare/page.tsx b/src/app/tools/compare/page.tsx
index 56099e92c..5b89060df 100644
--- a/src/app/tools/compare/page.tsx
+++ b/src/app/tools/compare/page.tsx
@@ -293,7 +293,16 @@ export default function Page() {
tankToCompareMember(tank, awaitedSkillDefinitions),
);
});
-
+ setAddTankDialogOpen(false);
+ }}
+ onSelectAll={(tanks) => {
+ mutateCompareTemporary((draft) => {
+ draft.members.push(
+ ...tanks.map((tank) =>
+ tankToCompareMember(tank, awaitedSkillDefinitions),
+ ),
+ );
+ });
setAddTankDialogOpen(false);
}}
/>
diff --git a/src/app/tools/tankopedia/components/TankSearch/index.tsx b/src/app/tools/tankopedia/components/TankSearch/index.tsx
index 0c9213cde..f1c8f9098 100644
--- a/src/app/tools/tankopedia/components/TankSearch/index.tsx
+++ b/src/app/tools/tankopedia/components/TankSearch/index.tsx
@@ -5,6 +5,7 @@ import {
TrashIcon,
} from '@radix-ui/react-icons';
import {
+ AlertDialog,
Button,
Card,
DropdownMenu,
@@ -51,11 +52,16 @@ import { Options } from './components/Options';
interface TankSearchProps {
compact?: boolean;
onSelect?: (tank: TankDefinition) => void;
+ onSelectAll?: (tanks: TankDefinition[]) => void;
}
const treeTypeOrder: TreeType[] = ['researchable', 'premium', 'collector'];
-export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
+export function TankSearch({
+ compact,
+ onSelect = () => {},
+ onSelectAll,
+}: TankSearchProps) {
const tanksPerPage = compact ? 16 : 96;
const nations = use(NATIONS);
const filters = useTankopediaPersistent((state) => state.filters);
@@ -796,10 +802,47 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
-
+
Sorting: {SORT_NAMES[sort.by]}, {sort.direction}
+
+ {onSelectAll && searchResults.length <= 8 && (
+
+ )}
+ {onSelectAll && searchResults.length > 8 && (
+
+
+
+
+
+
+
+ Woah! That's a lot of tanks.
+
+
+ Would you like to select{' '}
+ all {searchResults.length} tanks?
+
+
+
+
+
+
+
+ onSelectAll(searchResults)}>
+
+
+
+
+
+ )}
{!compact && (
@@ -935,6 +978,7 @@ export function TankSearch({ compact, onSelect = () => {} }: TankSearchProps) {
)}
+
>
);