PluginProbe
Code Snippets / trunk
Code Snippets vtrunk
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / js / components / ManageMenu / subpages.tsx

subpages.tsx in Code Snippets trunk, at js/components/ManageMenu/subpages.tsx

42 lines 1.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import { AiAgentDemo } from './AiAgentDemo/AiAgentDemo'
2 import { BlueprintsDemo } from './BlueprintsDemo/BlueprintsDemo'
3 import { CloudLibraryDemo } from './CloudLibraryDemo/CloudLibraryDemo'
4 import { CommunityCloud } from './CommunityCloud/CommunityCloud'
5 import { SnippetsTable } from './SnippetsTable'
6 import type React from 'react'
7
8 export const SUBPAGES = ['snippets', 'blueprints', 'cloud-community', 'cloud-library', 'ai-agent'] as const
9
10 export type SubpageName = typeof SUBPAGES[number]
11
12 export interface Subpage {
13 Component: React.FC
14
15 /**
16 * Marks a walkthrough tab. An 'announce' tab advertises itself as new until
17 * its walkthrough has been watched, which only a tab with a recorded demo
18 * can do; a 'quiet' tab is only ever labelled as a demo.
19 */
20 demo?: 'announce' | 'quiet'
21
22 /**
23 * Marks a premium tab, which is chipped as such without a licence.
24 */
25 isPro?: boolean
26 }
27
28 /**
29 * What each subpage of the manage screen renders, and how its toolbar tab
30 * advertises itself.
31 *
32 * The toolbar and the page body read the same entry, so a subpage is described
33 * once here rather than being kept in step across the two.
34 */
35 export const SUBPAGE_ENTRIES: Record<SubpageName, Subpage> = {
36 'snippets': { Component: SnippetsTable },
37 'blueprints': { Component: BlueprintsDemo, demo: 'announce' },
38 'cloud-community': { Component: CommunityCloud },
39 'cloud-library': { Component: CloudLibraryDemo, demo: 'quiet' },
40 'ai-agent': { Component: AiAgentDemo, demo: 'announce' },
41 }
42