feat: empty state i18n

This commit is contained in:
DIYgod 2023-07-31 18:43:18 +01:00
parent 78f0001f08
commit c30b40a118
No known key found for this signature in database
3 changed files with 14 additions and 5 deletions

View File

@ -1,10 +1,16 @@
export const EmptyState = ({ resource }: { resource?: string }) => {
"use client"
import { useTranslation } from "~/lib/i18n/client"
export const EmptyState = ({ resource = "post" }: { resource?: string }) => {
const { t } = useTranslation("common")
return (
<div className="text-center py-10 mb-10 text-2xl text-zinc-300 font-medium flex justify-center flex-col items-center">
<span className="icon-[mingcute--ghost-line] text-5xl mb-2"></span>
<div className="">
<div className="capitalize">
{" "}
No <span className="capitalize">{resource || "post"}</span> Yet.
{t(`No ${resource.charAt(0).toUpperCase() + resource.slice(1)} Yet`)}
</div>
</div>
)

View File

@ -48,7 +48,10 @@
"like revert": "请确认您是否想要撤销这个点赞操作?",
"Cancel": "取消",
"Confirm": "确认",
"No Content Yet.": "暂无内容",
"No Content Yet": "还没有内容",
"No Post Yet": "还没有文章",
"No Page Yet": "还没有页面",
"No Portfolio Yet": "还没有作品",
"Close": "关闭",
"Dashboard": "仪表盘",
"Copied!": "已复制!",

View File

@ -168,7 +168,7 @@ export async function getPagesBySite(input: {
cursor: string | null
}> => {
const [pinnedNote, notes] = await Promise.all([
!input.cursor ? getPinnedPage(input) : null,
!input.cursor && input.type === "post" ? getPinnedPage(input) : null,
await indexer.note.getMany({
characterId: input.characterId,