Imports tradein-mvp/frontend (38 components) to a claude.ai/design design-system project. Synth-entry build (Next.js app, no dist): - overrides/source-kit.mjs: process.env shim for browser IIFE - preview-provider.tsx: seeded TanStack Query provider (mirrors the repo's offline ui-preview client) so fetch-coupled + auth-gated cards render - previews/*.tsx: authored preview compositions (real fixture data) - conventions.md: README header for the design agent - config.json + NOTES.md: reproducible re-sync inputs
15 lines
758 B
TypeScript
15 lines
758 B
TypeScript
import { RouteGuard } from 'tradein-mvp-frontend';
|
||
|
||
/** RBAC-обёртка. useMe() читает /api/v1/me — в превью-окружении сети нет,
|
||
* поэтому guard рендерит свой gated-state (NoAccessScreen "Доступа нет" при
|
||
* ошибке /me, либо ничего во время загрузки). Fetch-coupled на useMe. */
|
||
export const Default = () => (
|
||
<RouteGuard>
|
||
<div className="card" style={{ padding: 24 }}>
|
||
<h2 style={{ margin: 0 }}>Защищённый раздел</h2>
|
||
<p style={{ margin: '8px 0 0', color: 'var(--fg-secondary)' }}>
|
||
Этот контент виден только при разрешённой роли.
|
||
</p>
|
||
</div>
|
||
</RouteGuard>
|
||
);
|