Skip to content

Commit a138dda

Browse files
committed
feat: Learning Hub Documentation & FAQ
1 parent aff3fd8 commit a138dda

10 files changed

Lines changed: 313 additions & 209 deletions

File tree

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
import { Icon, type IconName } from "@/components/ui/icon";
2+
import { BlockStack, InlineStack } from "@/components/ui/layout";
3+
import { Link } from "@/components/ui/link";
4+
import { Text } from "@/components/ui/typography";
5+
import { DOCUMENTATION_URL } from "@/utils/constants";
6+
import { tracking } from "@/utils/tracking";
7+
8+
interface QuickLink {
9+
id: string;
10+
label: string;
11+
href: string;
12+
icon: IconName;
13+
}
14+
15+
const QUICK_LINKS: QuickLink[] = [
16+
{
17+
id: "getting-started",
18+
label: "Getting started",
19+
href: `${DOCUMENTATION_URL}getting-started/first-pipeline/`,
20+
icon: "Rocket",
21+
},
22+
{
23+
id: "components",
24+
label: "Components",
25+
href: `${DOCUMENTATION_URL}core-concepts/what-are-components/`,
26+
icon: "Package",
27+
},
28+
{
29+
id: "pipelines",
30+
label: "Pipelines",
31+
href: `${DOCUMENTATION_URL}core-concepts/understanding-inputs-outputs/`,
32+
icon: "GitBranch",
33+
},
34+
{
35+
id: "secrets",
36+
label: "Secrets & auth",
37+
href: `${DOCUMENTATION_URL}core-concepts/secrets/`,
38+
icon: "Lock",
39+
},
40+
{
41+
id: "runs",
42+
label: "Running pipelines",
43+
href: `${DOCUMENTATION_URL}core-concepts/tasks-and-executions/`,
44+
icon: "Play",
45+
},
46+
{
47+
id: "schema",
48+
label: "Schema reference",
49+
href: `${DOCUMENTATION_URL}reference/schema/`,
50+
icon: "Code",
51+
},
52+
];
53+
54+
function QuickLinkPill({ link }: { link: QuickLink }) {
55+
return (
56+
<a
57+
href={link.href}
58+
target="_blank"
59+
rel="noopener noreferrer"
60+
className="inline-flex items-center gap-1.5 px-3 py-1 rounded-full border border-border hover:border-primary/40 hover:bg-muted/40 transition-all no-underline"
61+
{...tracking("learning_hub.documentation.quick_link", {
62+
link_id: link.id,
63+
})}
64+
>
65+
<Icon
66+
name={link.icon}
67+
size="xs"
68+
className="text-muted-foreground shrink-0"
69+
aria-hidden="true"
70+
/>
71+
<Text size="sm" weight="semibold">
72+
{link.label}
73+
</Text>
74+
</a>
75+
);
76+
}
77+
78+
export function DocsQuickLinks() {
79+
return (
80+
<BlockStack gap="1">
81+
<Text size="sm" weight="semibold" className="text-muted-foreground">
82+
Quick links
83+
</Text>
84+
<InlineStack gap="2">
85+
{QUICK_LINKS.map((link) => (
86+
<QuickLinkPill key={link.id} link={link} />
87+
))}
88+
<Link
89+
href={DOCUMENTATION_URL}
90+
external
91+
variant="primary"
92+
size="sm"
93+
className="ml-1"
94+
{...tracking("learning_hub.documentation.full_docs")}
95+
>
96+
Full docs
97+
</Link>
98+
</InlineStack>
99+
</BlockStack>
100+
);
101+
}

‎src/components/Learn/DocumentationPanel.tsx‎

Lines changed: 0 additions & 198 deletions
This file was deleted.

‎src/components/Learn/FaqPanel.tsx‎

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import {
2+
Collapsible,
3+
CollapsibleContent,
4+
CollapsibleTrigger,
5+
} from "@/components/ui/collapsible";
6+
import { Icon } from "@/components/ui/icon";
7+
import { BlockStack, InlineStack } from "@/components/ui/layout";
8+
import { Heading, Paragraph, Text } from "@/components/ui/typography";
9+
import { tracking } from "@/utils/tracking";
10+
11+
import faqItems from "./faq.json";
12+
13+
interface FaqItem {
14+
id: string;
15+
question: string;
16+
answer: string;
17+
}
18+
19+
const FAQ_ITEMS = faqItems as FaqItem[];
20+
21+
function FaqRow({ item }: { item: FaqItem }) {
22+
return (
23+
<Collapsible className="w-full border-b border-border">
24+
<CollapsibleTrigger
25+
className="group w-full flex items-start justify-between gap-3 py-3 text-left cursor-pointer"
26+
{...tracking("learning_hub.documentation.faq_toggle", {
27+
faq_id: item.id,
28+
})}
29+
>
30+
<Text size="sm" weight="semibold" className="flex-1 min-w-0">
31+
{item.question}
32+
</Text>
33+
<Icon
34+
name="ChevronDown"
35+
size="sm"
36+
className="text-muted-foreground shrink-0 mt-0.5 transition-transform duration-200 group-data-[state=open]:rotate-180"
37+
aria-hidden="true"
38+
/>
39+
</CollapsibleTrigger>
40+
<CollapsibleContent>
41+
<Paragraph size="sm" tone="subdued" className="pb-3 pr-6">
42+
{item.answer}
43+
</Paragraph>
44+
</CollapsibleContent>
45+
</Collapsible>
46+
);
47+
}
48+
49+
export function FaqPanel() {
50+
return (
51+
<BlockStack gap="4" align="stretch">
52+
<InlineStack gap="3" blockAlign="center">
53+
<Icon
54+
name="MessageCircleQuestionMark"
55+
size="md"
56+
className="text-primary"
57+
aria-hidden="true"
58+
/>
59+
<Heading level={2}>Frequently asked</Heading>
60+
</InlineStack>
61+
62+
<BlockStack align="stretch">
63+
{FAQ_ITEMS.map((item) => (
64+
<FaqRow key={item.id} item={item} />
65+
))}
66+
</BlockStack>
67+
</BlockStack>
68+
);
69+
}

0 commit comments

Comments
 (0)