Files
FarmaFinder/apps/frontend/src/components/SearchBar.jsx
T
Antoni Nuñez Romeu fe22e6ee9b
Run Tests on Branches / Backend Tests (push) Failing after 17s
Run Tests on Branches / Frontend Tests (push) Failing after 17s
Profile and design hotfixes
2026-07-07 01:45:09 +02:00

36 lines
981 B
React

import React from 'react';
import './SearchBar.css';
function SearchBar({ value, onChange, placeholder }) {
return (
<div className="search-bar-container">
<div className="search-bar">
<span className="search-icon">
<svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round">
<circle cx="11" cy="11" r="7" />
<path d="m20 20-3.5-3.5" />
</svg>
</span>
<input
type="text"
value={value}
onChange={(e) => onChange(e.target.value)}
placeholder={placeholder}
className="search-input"
/>
{value && (
<button
className="clear-button"
onClick={() => onChange('')}
aria-label="Limpiar búsqueda"
>
</button>
)}
</div>
</div>
);
}
export default SearchBar;