import { useGlobal } from '@/lib/global' import Link from 'next/link' import { useEffect, useRef } from 'react' import Card from './Card' import SearchInput from './SearchInput' import TagItemMini from './TagItemMini' /** * 搜索页面的导航 * @param {*} props * @returns */ export default function SearchNav(props) { const { tagOptions, categoryOptions } = props const cRef = useRef(null) const { locale } = useGlobal() useEffect(() => { // 自动聚焦到搜索框 cRef?.current?.focus() }, []) return <>
{/* 分类 */}
{locale.COMMON.CATEGORY}:
{categoryOptions?.map(category => { return (
{category.name}({category.count})
) })}
{/* 标签 */}
{locale.COMMON.TAGS}:
{tagOptions?.map(tag => { return (
) })}
}