diff options
| author | Volpeon <git@volpeon.ink> | 2026-07-22 19:40:59 +0200 |
|---|---|---|
| committer | Volpeon <git@volpeon.ink> | 2026-07-22 19:40:59 +0200 |
| commit | c1e28224aa2e1450031669d9a7e359b63e04687d (patch) | |
| tree | 68f3d8905c763a91f68001d868197effa92adafa /src/ui/objects/CollapseCard.tsx | |
| download | corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.tar.gz corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.tar.bz2 corvos-website-c1e28224aa2e1450031669d9a7e359b63e04687d.zip | |
Init
Diffstat (limited to 'src/ui/objects/CollapseCard.tsx')
| -rw-r--r-- | src/ui/objects/CollapseCard.tsx | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ui/objects/CollapseCard.tsx b/src/ui/objects/CollapseCard.tsx new file mode 100644 index 0000000..27e1ce2 --- /dev/null +++ b/src/ui/objects/CollapseCard.tsx | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | import { Card, type Props as CardProps } from "./Card.tsx"; | ||
| 2 | import { CardBody } from "./CardBody.tsx"; | ||
| 3 | import { Heading } from "./Heading.tsx"; | ||
| 4 | |||
| 5 | export type Props = CardProps<"details"> & { | ||
| 6 | "heading-level": "h1" | "h2" | "h3" | "h4" | "h5" | "h6"; | ||
| 7 | "title"?: JSX.Element; | ||
| 8 | "header"?: JSX.Element; | ||
| 9 | }; | ||
| 10 | |||
| 11 | export const CollapseCard = ({ | ||
| 12 | "heading-level": headingLevel, | ||
| 13 | children, | ||
| 14 | title, | ||
| 15 | header, | ||
| 16 | ...props | ||
| 17 | }: Props) => ( | ||
| 18 | <Card as="details" {...props}> | ||
| 19 | <CardBody as="summary"> | ||
| 20 | <Heading as={headingLevel} class="u-mbs-0" level="lg"> | ||
| 21 | {title} | ||
| 22 | </Heading> | ||
| 23 | {header} | ||
| 24 | </CardBody> | ||
| 25 | <CardBody>{children}</CardBody> | ||
| 26 | </Card> | ||
| 27 | ); | ||
