Debian Codegraph @

pkg/playground/react-demo-cards.jsx

raw
1 /*
2 * Copyright (C) 2019 Red Hat, Inc.
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6 import React from "react";
7
8 import { Button } from "@patternfly/react-core/dist/esm/components/Button/index.js";
9 import { Card, CardBody, CardFooter, CardHeader, CardTitle } from '@patternfly/react-core/dist/esm/components/Card/index.js';
10 import { Gallery, GalleryItem } from "@patternfly/react-core/dist/esm/layouts/Gallery/index.js";
11
12 export const CardsDemo = () => {
13 const cards = [
14 <Card isCompact key="card1">
15 <CardBody>I'm a card in a gallery</CardBody>
16 </Card>,
17 <Card isCompact key="card2">
18 <CardBody>I'm a card in a gallery</CardBody>
19 <CardFooter>I have a footer</CardFooter>
20 </Card>,
21 <Card isCompact key="card3">
22 <CardBody>I'm a card in a gallery</CardBody>
23 </Card>,
24 <Card isCompact key="card4">
25 <CardTitle>I have a header too</CardTitle>
26 <CardBody>I'm a card in a gallery</CardBody>
27 </Card>,
28 <Card key="card5">
29 <CardHeader actions={{
30 actions: <><input type="checkbox" />
31 <Button className="btn">click</Button></>,
32 }} />
33 <CardTitle>This is a card header</CardTitle>
34 <CardBody>I'm a card in a gallery</CardBody>
35 </Card>,
36 <GalleryItem key="card6">
37 I'm not a card, but I'm in the gallery too, as a generic GalleryItem.
38 </GalleryItem>,
39 ];
40 return (
41 <Gallery hasGutter>
42 { cards }
43 </Gallery>
44 );
45 };