import { useState } from 'react'; import { Search } from 'lucide-react' import styled from 'styled-components'; const Input = styled.input` height: 30px; width: 300px; border-radius: 2px; ` const TopNavBarWrapper = styled.div` padding: 20px; gap: 0; i { font-size: 20.5px; } ${Input} { font-size: 14px; border-radius: 2px; background-color: rgba(51, 51, 51, .4); /* color: hsl(var(--muted) / .4); */ //#333333; transition: 0.1s ease-in-out; } ${Input}:focus { width: 340px; transition: 0.1s ease-in-out; outline: none; color: #f8f8f8; & ~ .searchBtn { background-color: hsl(var(--muted) / .3); /* background-color: rgb(255 255 255 / 0.2); */ } & ~ .searchBtn i { // color: hsl(var(--muted) / .9); color: gray; } & ~ i { transition: 0.1s ease-in-out; } } ${Input}::placeholder { color: gray; // color: rgba(51, 51, 51, 0.5) /* color: hsl(var(--muted) / .9); */ } ` const InputWrapper = styled.div` display: flex; justify-content: center; align-items: center; align-self: center; ` const SearchBar = ({ onSearchSubmit }) => { const [query, setQuery] = useState(''); const handleInputChange = (event) => { setQuery(event.target.value) }; const handleSubmit = (event) => { event.preventDefault() onSearchSubmit(query) setQuery('') }; return (
) } export default SearchBar