All checks were successful
Build and Deploy / build-and-deploy (push) Successful in 6s
页面 (电商AI平台/) - account / team / settings / index / products / projects: 累积迭代 - restraint.css: 设计 token 补充 - login.html / register.html: 新增登录注册页 - _ARCHIVE.md: 归档说明 Next.js 工程骨架 - app/ + components/: 新一代 SPA 雏形 (page / layout / sidebar / topbar / GridBg / Icon) - package.json / package-lock.json / next.config.mjs / tsconfig.json / postcss.config.mjs / next-env.d.ts 历史归档 / 文档 - v1/: 原 V1 静态稿镜像 (含 mockup-A/B/C) - PRD.md / deployment-guide.md / _check.html - ui参考/ / screenshots/ 杂项 - .gitignore 调整 - 删除根 README.md Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
66 lines
1.8 KiB
TypeScript
66 lines
1.8 KiB
TypeScript
import Link from "next/link";
|
|
import Icon from "./Icon";
|
|
|
|
export interface Crumb {
|
|
label: string;
|
|
href?: string;
|
|
}
|
|
|
|
interface Props {
|
|
/** Pass crumbs to show breadcrumbs (e.g. inner pages). Omit to show the team switcher (workspace). */
|
|
crumbs?: Crumb[];
|
|
balance?: string;
|
|
}
|
|
|
|
export default function Topbar({ crumbs, balance = "¥327.40" }: Props) {
|
|
return (
|
|
<header className="topbar">
|
|
{crumbs && crumbs.length > 0 ? (
|
|
<nav className="crumbs">
|
|
{crumbs.map((c, i) => {
|
|
const last = i === crumbs.length - 1;
|
|
const sep = i > 0 ? <span key={`s-${i}`} className="sep">/</span> : null;
|
|
return last ? (
|
|
<span key={c.label}>{sep}<span className="here">{c.label}</span></span>
|
|
) : (
|
|
<span key={c.label}>
|
|
{sep}
|
|
{c.href ? <Link href={c.href}>{c.label}</Link> : <span>{c.label}</span>}
|
|
</span>
|
|
);
|
|
})}
|
|
</nav>
|
|
) : (
|
|
<div className="team-switcher" role="button">
|
|
<div className="p">个</div>
|
|
个人工作室
|
|
<Icon name="chev-down" size={12} className="chev" />
|
|
</div>
|
|
)}
|
|
|
|
<div className="top-r">
|
|
<span className="balance-chip">
|
|
<Icon name="coin" size={13} />
|
|
余额 <strong>{balance}</strong>
|
|
</span>
|
|
<button className="icon-btn" aria-label="通知">
|
|
<Icon name="bell" />
|
|
<span className="dot" />
|
|
</button>
|
|
<button className="pill-btn">
|
|
<Icon name="help" />
|
|
帮助
|
|
</button>
|
|
<button className="pill-btn">
|
|
<Icon name="doc" />
|
|
文档
|
|
</button>
|
|
<button className="pill-btn upgrade">
|
|
<Icon name="up" />
|
|
升级
|
|
</button>
|
|
</div>
|
|
</header>
|
|
);
|
|
}
|