'use client'; import React, { useState } from 'react'; import { useRouter } from 'next/navigation'; const ResearchSearch = () => { const [query, setQuery] = useState(''); const [activeFilter, setActiveFilter] = useState('Researchers'); const filters = ['Researchers', 'Labs', 'Projects', 'Institutes']; const router = useRouter(); const handleSearch = () => { const params = new URLSearchParams({ q: query, type: activeFilter }); router.push(`/research/search?${params.toString()}`); }; return (
{/* Search bar */}
setQuery(e.target.value)} onKeyDown={(e) => e.key === 'Enter' && handleSearch()} placeholder="Search across researchers, labs, projects, and disciplines..." style={{ width: '100%', paddingLeft: '3rem', paddingRight: '8rem', paddingTop: '1rem', paddingBottom: '1rem', backgroundColor: '#ffffff', border: '1px solid #e5e7eb', borderRadius: '1rem', boxShadow: '0 1px 2px 0 rgba(0,0,0,0.05)', fontSize: '1rem', color: '#374151', outline: 'none', transition: 'border-color 0.2s, box-shadow 0.2s', boxSizing: 'border-box', }} onFocus={(e) => { e.target.style.borderColor = '#263c6f'; e.target.style.boxShadow = '0 0 0 2px rgba(38,60,111,0.15)'; }} onBlur={(e) => { e.target.style.borderColor = '#e5e7eb'; e.target.style.boxShadow = '0 1px 2px 0 rgba(0,0,0,0.05)'; }} />
{/* Filter pills */}
Filters: {filters.map((filter) => ( ))}
); }; export default ResearchSearch;