diff --git a/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/list/page.tsx b/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/list/page.tsx
index 45187354..591e91fb 100644
--- a/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/list/page.tsx
+++ b/app/[board_name]/[layout_id]/[size_id]/[set_ids]/[angle]/list/page.tsx
@@ -29,7 +29,7 @@ export default async function DynamicResultsPage({
fetchBoardDetails(parsedParams.board_name, parsedParams.layout_id, parsedParams.size_id, parsedParams.set_ids),
]);
- if (!fetchedResults || fetchedResults.climbs.length === 0) {
+ if (!fetchedResults || fetchedResults.climbs?.length === 0) {
notFound();
}
diff --git a/app/components/search-drawer/basic-search-form.tsx b/app/components/search-drawer/basic-search-form.tsx
index 7b0a8b96..81df5e31 100644
--- a/app/components/search-drawer/basic-search-form.tsx
+++ b/app/components/search-drawer/basic-search-form.tsx
@@ -1,75 +1,103 @@
'use client';
import React from 'react';
-import { Form, InputNumber, Row, Col, Select, Input } from 'antd';
+import { Form, InputNumber, Row, Col, Select, Input, Switch, Alert, Typography, Slider } from 'antd';
import { TENSION_KILTER_GRADES } from '@/app/lib/board-data';
import { useUISearchParams } from '@/app/components/queue-control/ui-searchparams-provider';
import SearchClimbNameInput from './search-climb-name-input';
+import { useBoardProvider } from '../board-provider/board-provider-context';
+
+const { Title } = Typography;
const BasicSearchForm: React.FC = () => {
const { uiSearchParams, updateFilters } = useUISearchParams();
+ const { user } = useBoardProvider();
+ const userId = user?.id;
const grades = TENSION_KILTER_GRADES;
- const handleGradeChange = (type: 'min' | 'max', value: number | undefined) => {
- if (type === 'min') {
- updateFilters({ minGrade: value });
- } else {
- updateFilters({ maxGrade: value });
+ const renderLogbookSection = () => {
+ if (!userId) {
+ return (
+
+
+
+ );
}
+
+ return (
+ <>
+
+ updateFilters({ showDone: checked })}
+ />
+
+
+
+ updateFilters({ showAttempted: checked })}
+ />
+
+
+
+ updateFilters({ showNotAttempted: checked })}
+ />
+
+
+
+ updateFilters({ showOnlyLiked: checked })}
+ />
+
+ >
+ );
};
return (
-
-
-
-
-
-
-
-
-
-
-
-
-
+ difficulty_id === uiSearchParams.minGrade)?.difficulty_name,
+ },
+ [uiSearchParams.maxGrade]: {
+ style: { transform: 'translate(-5px, -30px)' },
+ label: grades.find(({ difficulty_id }) => difficulty_id === uiSearchParams.maxGrade)?.difficulty_name,
+ },
+ }}
+ onChange={(value) => updateFilters({ minGrade: value[0], maxGrade: value[1] })}
+ />
updateFilters({ minAscents: value || undefined })}
+ onChange={(value) => updateFilters({ minAscents: value || 10 })}
style={{ width: '100%' }}
- placeholder="Any"
/>
@@ -106,30 +134,26 @@ const BasicSearchForm: React.FC = () => {
max={3.0}
step={0.1}
value={uiSearchParams.minRating}
- onChange={(value) => updateFilters({ minRating: value || undefined })}
+ onChange={(value) => updateFilters({ minRating: value || 1 })}
style={{ width: '100%' }}
- placeholder="Any"
/>
-
-
+
+ updateFilters({ onlyClassics: checked })}
+ />