-
Notifications
You must be signed in to change notification settings - Fork 0
/
Cards.ts
43 lines (33 loc) · 1.05 KB
/
Cards.ts
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
import { h, fixOptions, vNode, vAttrs } from "suika";
import { getTagName } from "../utils";
export const Card = (options: vAttrs, children: vNode[]): vNode => {
const props = fixOptions(options, {
className: "card",
});
return h("div", props, ...children);
};
export const CardHeader = (options: vAttrs, children: vNode[]): vNode => {
const props = fixOptions(options, {
className: "card-header",
});
return h("div", props, ...children);
};
export const CardTitle = (options: vAttrs, children: vNode[]): vNode => {
const tag = getTagName(options, "h1");
const props = fixOptions(options, {
className: "card-title",
});
return h(tag, props, ...children);
};
export const CardBody = (options: vAttrs, children: vNode[]): vNode => {
const props = fixOptions(options, {
className: "card-body",
});
return h("div", props, ...children);
};
export const CardFooter = (options: vAttrs, children: vNode[]): vNode => {
const props = fixOptions(options, {
className: "card-footer",
});
return h("div", props, ...children);
};