适配无标签文章
This commit is contained in:
tangly
2021-12-06 20:39:26 +08:00
parent 22c421a0c3
commit 97266b130f
7 changed files with 12 additions and 8 deletions

View File

@@ -2,8 +2,13 @@ import { faTag } from '@fortawesome/free-solid-svg-icons'
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'
import Link from 'next/link'
import React from 'react'
import { useGlobal } from '@/lib/global'
const TagItem = ({ tag, selected }) => {
const { locale } = useGlobal()
if (!tag) {
<>{locale.COMMON.NOTAG}</>
}
return (
<Link href={selected ? '/' : `/tag/${encodeURIComponent(tag.name)}`} passHref>
<li