Refactored and cleaned up code

This commit is contained in:
2023-09-13 23:35:22 -04:00
parent 68a442bed2
commit 4673a5ea07
16 changed files with 332 additions and 353 deletions

View File

@@ -0,0 +1,27 @@
'use client';
import { Avatar } from 'antd';
import Search from 'antd/es/input/Search';
import { useRouter } from 'next/navigation';
import { AiOutlineUser } from 'react-icons/ai';
export default function Topbar() {
const router = useRouter();
function onSearch(value: string) {
router.push(`/airports/${value}`);
}
return (
<nav className='w-screen flex bg-gray-700 text-gray-200'>
<Search
placeholder='Search Airports...'
onSearch={onSearch}
enterButton
className='p-2'
style={{ width: '20em' }}
/>
<Avatar shape='square' size={48} icon={<AiOutlineUser />} />
</nav>
);
}