feat(ui): refine dashboard configuration pages
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { EmptyState } from "@/components/ui/empty-state"
|
||||
import { Input } from "@/components/ui/input"
|
||||
import { Label } from "@/components/ui/label"
|
||||
import {
|
||||
@@ -17,22 +18,34 @@ import { toApiError } from "@/lib/errors"
|
||||
import { useMyShop } from "@/lib/hooks/use-my-shop"
|
||||
import { notifyInfo, notifySuccess } from "@/lib/toast"
|
||||
import type { Shop } from "@/lib/types"
|
||||
import { Save } from "lucide-react"
|
||||
import { AlertCircle, Save } from "lucide-react"
|
||||
import { useState } from "react"
|
||||
|
||||
export default function ShopRulesPage() {
|
||||
const { shop, setShop, loading, error } = useMyShop()
|
||||
|
||||
if (loading) {
|
||||
return <div className="text-sm text-muted-foreground">加载中...</div>
|
||||
return (
|
||||
<div className="container mx-auto max-w-4xl px-4 py-8">
|
||||
<EmptyState title="规则加载中" icon={Save} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
if (error) {
|
||||
return <div className="text-sm text-muted-foreground">{error}</div>
|
||||
return (
|
||||
<div className="container mx-auto max-w-4xl 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-4xl px-4 py-8">
|
||||
<EmptyState title="当前账号没有可管理的店铺" icon={Save} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
return <ShopRulesForm key={shop.id} shop={shop} setShop={setShop} />
|
||||
@@ -83,7 +96,7 @@ function ShopRulesForm({ shop, setShop }: { shop: Shop; setShop: (shop: Shop | n
|
||||
</div>
|
||||
|
||||
<div className="grid gap-6">
|
||||
<Card className="hover:shadow-card-hover">
|
||||
<Card className="border-border/80 shadow-sm">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-base">员工权限</CardTitle>
|
||||
</CardHeader>
|
||||
@@ -117,7 +130,7 @@ function ShopRulesForm({ shop, setShop }: { shop: Shop; setShop: (shop: Shop | n
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card className="hover:shadow-card-hover">
|
||||
<Card className="border-border/80 shadow-sm">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-base">派单设置</CardTitle>
|
||||
</CardHeader>
|
||||
@@ -143,7 +156,7 @@ function ShopRulesForm({ shop, setShop }: { shop: Shop; setShop: (shop: Shop | n
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
<Card className="hover:shadow-card-hover">
|
||||
<Card className="border-border/80 shadow-sm">
|
||||
<CardHeader>
|
||||
<CardTitle className="text-base">抽成设置</CardTitle>
|
||||
</CardHeader>
|
||||
|
||||
Reference in New Issue
Block a user