feat(ui): refine dashboard configuration pages

This commit is contained in:
zetaloop
2026-04-25 21:48:57 +08:00
parent 14f6f5509a
commit ac382960dd
4 changed files with 95 additions and 34 deletions
@@ -10,6 +10,7 @@ import {
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
import { EmptyState } from "@/components/ui/empty-state"
import { Input } from "@/components/ui/input"
import {
Table,
@@ -30,7 +31,7 @@ import { toApiError } from "@/lib/errors"
import { useMyShop } from "@/lib/hooks/use-my-shop"
import { notifyInfo, notifySuccess } from "@/lib/toast"
import type { Player } from "@/lib/types"
import { MoreHorizontal, Star, UserPlus } from "lucide-react"
import { AlertCircle, MoreHorizontal, Star, UserPlus } from "lucide-react"
import Link from "next/link"
import { useCallback, useEffect, useMemo, useState } from "react"
@@ -131,15 +132,27 @@ export default function EmployeesPage() {
)
if (loading) {
return <div className="text-sm text-muted-foreground">...</div>
return (
<div className="container mx-auto max-w-6xl px-4 py-8">
<EmptyState title="员工信息加载中" icon={UserPlus} />
</div>
)
}
if (error) {
return <div className="text-sm text-muted-foreground">{error}</div>
return (
<div className="container mx-auto max-w-6xl px-4 py-8">
<EmptyState title="员工信息加载失败" description={error} icon={AlertCircle} />
</div>
)
}
if (!shop) {
return <div className="text-sm text-muted-foreground"></div>
return (
<div className="container mx-auto max-w-6xl px-4 py-8">
<EmptyState title="当前账号没有可管理的店铺" icon={UserPlus} />
</div>
)
}
const handleInvite = async () => {
@@ -185,7 +198,7 @@ export default function EmployeesPage() {
</Button>
</div>
<Card className="hover:shadow-card-hover">
<Card className="border-border/80 shadow-sm">
<CardHeader>
<div className="flex items-center justify-between">
<CardTitle className="text-base"> ({filteredPlayers.length})</CardTitle>
@@ -212,14 +225,19 @@ export default function EmployeesPage() {
<TableBody>
{dataLoading ? (
<TableRow>
<TableCell colSpan={6} className="text-center text-sm text-muted-foreground">
...
<TableCell colSpan={6} className="py-6">
<EmptyState title="员工加载中" icon={UserPlus} className="min-h-[180px]" />
</TableCell>
</TableRow>
) : filteredPlayers.length === 0 ? (
<TableRow>
<TableCell colSpan={6} className="text-center text-sm text-muted-foreground">
<TableCell colSpan={6} className="py-6">
<EmptyState
title="暂无签约打手"
description="邀请打手加入后会出现在这里。"
icon={UserPlus}
className="min-h-[180px] border-dashed"
/>
</TableCell>
</TableRow>
) : (
@@ -248,7 +266,7 @@ export default function EmployeesPage() {
</TableCell>
<TableCell>
<div className="flex items-center gap-1">
<Star className="h-3.5 w-3.5 fill-yellow-400 text-yellow-400" />
<Star className="h-3.5 w-3.5 fill-warning text-warning" />
{player.rating}
</div>
</TableCell>