forked from TypeCellOS/BlockNote
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExampleCards.tsx
More file actions
54 lines (53 loc) · 1.88 KB
/
ExampleCards.tsx
File metadata and controls
54 lines (53 loc) · 1.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
import { Card, Cards } from "fumadocs-ui/components/card";
import { Heading } from "fumadocs-ui/components/heading";
import { Fragment } from "react";
import { exampleGroupsData } from "./example/generated/exampleGroupsData.gen";
import { ProBadge } from "./ProBadge";
export default function ExampleCards() {
return (
<>
{exampleGroupsData.map((exampleGroupData) => (
<Fragment key={exampleGroupData.exampleGroupName}>
<Heading as="h2" key={exampleGroupData.exampleGroupName + "-heading"}>
{exampleGroupData.title}
</Heading>
<Cards
key={exampleGroupData.exampleGroupName + "-cards"}
className="mb-8 grid-cols-1 sm:grid-cols-2 lg:grid-cols-3"
>
{exampleGroupData.examplesData.map((exampleData) => (
<Card
className="@max-lg:col-span-1"
key={
exampleGroupData.exampleGroupName +
"-" +
exampleData.exampleName
}
icon={
exampleData.author ? (
<img
src={`https://github.com/${exampleData.author}.png`}
alt={exampleData.author}
width={32}
/>
) : undefined
}
title={
<span>
<span className="mr-1">{exampleData.title}</span>
{exampleData.isPro && <ProBadge />}
</span>
}
description={
exampleData.author ? `by ${exampleData.author}` : undefined
}
href={`examples/${exampleGroupData.exampleGroupName}/${exampleData.exampleName}`}
external={false}
/>
))}
</Cards>
</Fragment>
))}
</>
);
}