"use client"; import { useState } from "react"; import { getLocation } from "@/app/actions"; import { LocationType } from "@/types/types"; export default function LocationSearch(props: any) { const [searchLocation, setSearchLocation] = useState("Sluseholmen"); const setLocation = props.setLocation; const handleChange = (e: React.ChangeEvent) => { setSearchLocation(e.target.value); }; const handleKeyDown = (e: any) => { if (e.key === "Enter") { const location: LocationType = getLocation(searchLocation); setLocation(location); } }; return ( <>

{searchLocation}

); }