CI / Static checks (push) Has been cancelled
CI / Production build (push) Has been cancelled
CI / API integration (push) Has been cancelled
CI / Taro builds (acheng-campus-food) (push) Has been cancelled
CI / Taro builds (atelier-solopreneur) (push) Has been cancelled
CI / Taro builds (linjing-editorial) (push) Has been cancelled
CI / Browser regression (push) Has been cancelled
44 lines
1.7 KiB
TypeScript
44 lines
1.7 KiB
TypeScript
import { Button, Card, Col, Row } from "antd";
|
|
import { AppstoreOutlined } from "@ant-design/icons";
|
|
import { useNavigate } from "react-router-dom";
|
|
import { AdminPageHeader } from "../../components/AdminPageHeader.js";
|
|
import { EmptyState } from "../../components/EmptyState.js";
|
|
import { QueryState } from "../../components/QueryState.js";
|
|
import { CapabilityCard } from "./components/CapabilityCard.js";
|
|
import { useCapabilityQuery } from "./hooks/useCapabilityQueries.js";
|
|
|
|
export function CapabilitiesPage() {
|
|
const navigate = useNavigate();
|
|
const query = useCapabilityQuery();
|
|
|
|
return (
|
|
<QueryState loading={query.isLoading} error={query.error} onRetry={() => void query.refetch()}>
|
|
<AdminPageHeader
|
|
title="能力插件"
|
|
description="以经营者视角调整当前页面方案提供的业务能力;保存后进入草稿,发布后生效。"
|
|
/>
|
|
{query.data?.length ? (
|
|
<Row gutter={[16, 16]} className="admin-equal-height">
|
|
{query.data.map((capability) => (
|
|
<Col key={capability.capabilityKey} xs={24} lg={12}>
|
|
<CapabilityCard capability={capability} />
|
|
</Col>
|
|
))}
|
|
</Row>
|
|
) : (
|
|
<Card>
|
|
<EmptyState
|
|
icon={<AppstoreOutlined />}
|
|
title="当前页面方案没有可配置能力"
|
|
description="能力由品牌当前使用的业务类型和页面方案决定。"
|
|
action={<Button onClick={() => navigate("/admin/page-scheme")}>查看页面方案</Button>}
|
|
/>
|
|
</Card>
|
|
)}
|
|
<p className="admin-page-header-description admin-offset-top">
|
|
技术信息仅用于排查问题,不作为运营判断依据。
|
|
</p>
|
|
</QueryState>
|
|
);
|
|
}
|