diff --git a/src/app/_components/FilterMenu.tsx b/src/app/_components/FilterMenu.tsx index 19bd7ce..dc8e65a 100644 --- a/src/app/_components/FilterMenu.tsx +++ b/src/app/_components/FilterMenu.tsx @@ -29,6 +29,7 @@ export default function Filtermenu() { const value = Math.max(Number(e.target.value), minPrice + 1); setMaxPrice(value); setSliderValues([sliderValues[0], value]); + setStorePrice(minPrice, maxPrice); }; const handleSliderChange = (values: [number, number]) => { diff --git a/src/app/_components/WineName.tsx b/src/app/_components/WineName.tsx deleted file mode 100644 index 451294b..0000000 --- a/src/app/_components/WineName.tsx +++ /dev/null @@ -1,3 +0,0 @@ -export default function WineName(props: { name: string }) { - return
{props.name}
; -} diff --git a/src/app/_components/WineProducer.tsx b/src/app/_components/WineProducer.tsx deleted file mode 100644 index 415d9c2..0000000 --- a/src/app/_components/WineProducer.tsx +++ /dev/null @@ -1,25 +0,0 @@ -import getProducer from "~/server/actions/getProducer"; - -export default async function WineProducer(props: { id: string }) { - const { id } = props; - - // Validate the id before making the database call - if (!id) { - returnInvalid producer ID
; - } - - try { - const result = await getProducer(id); - return !result ?Unable to retrieve producer
:{result?.name}
; - } catch (error) { - console.error("Error fetching producer:", error); - returnError fetching producer
; - } -} - -// Utility function to validate UUID -function isValidUUID(uuid: string) { - const uuidRegex = - /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i; - return uuidRegex.test(uuid); -} diff --git a/src/app/store.ts b/src/app/store.ts index 1197306..9fc1053 100644 --- a/src/app/store.ts +++ b/src/app/store.ts @@ -7,6 +7,7 @@ interface FilterState { } interface Filters { + searchQuery: string; regions: string[]; countries: string[]; producers: string[]; @@ -40,6 +41,7 @@ type FilterActions = { }; const initialFilters: Filters = { + searchQuery: "", regions: [], countries: [], producers: [], @@ -60,6 +62,7 @@ const useFilterStore = create