fix(shop): render backend template defaults
This commit is contained in:
@@ -5,6 +5,7 @@ import { Button } from "@/components/ui/button"
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Separator } from "@/components/ui/separator"
|
||||
import { getShopById, listPlayersByShop, listReviews, listServices } from "@/lib/api"
|
||||
import { getShopSections } from "@/lib/domain/shop-template"
|
||||
import { Gamepad2, Megaphone, ShoppingBag, Star, Users } from "lucide-react"
|
||||
import Image from "next/image"
|
||||
import Link from "next/link"
|
||||
@@ -26,9 +27,7 @@ export default async function ShopPage({ params }: PageProps) {
|
||||
const playerIds = shopPlayers.map((p) => p.id)
|
||||
const shopServices = allServices.filter((s) => playerIds.includes(s.playerId))
|
||||
const shopReviews = await listReviews()
|
||||
const sortedSections = [...shop.templateConfig.sections]
|
||||
.filter((s) => s.enabled)
|
||||
.sort((a, b) => a.order - b.order)
|
||||
const sortedSections = getShopSections(shop).filter((s) => s.enabled)
|
||||
|
||||
return (
|
||||
<div className="container mx-auto py-6 space-y-8">
|
||||
@@ -84,7 +83,7 @@ export default async function ShopPage({ params }: PageProps) {
|
||||
<div className="flex items-center gap-4">
|
||||
<Avatar className="w-16 h-16">
|
||||
<AvatarImage src={shop.owner.avatar} />
|
||||
<AvatarFallback>{shop.owner.nickname[0]}</AvatarFallback>
|
||||
<AvatarFallback>{shop.owner.nickname[0] ?? "店"}</AvatarFallback>
|
||||
</Avatar>
|
||||
<div>
|
||||
<p className="font-medium">店长:{shop.owner.nickname}</p>
|
||||
|
||||
Reference in New Issue
Block a user