Debian Codegraph @

node/@patternfly/react-core/src/demos/examples/Skeleton/SkeletonCard.tsx

raw
1 import { Gallery, Flex, PageSection, Content, Card, CardBody, Skeleton } from '@patternfly/react-core';
2 import { DashboardWrapper } from '@patternfly/react-core/src/demos/DashboardWrapper';
3
4 export const SkeletonCard: React.FunctionComponent = () => {
5 const card = (index: number) => (
6 <Card key={index} isCompact>
7 <CardBody>
8 <Flex direction={{ default: 'column' }} spacer={{ default: 'spacerMd' }}>
9 <Skeleton screenreaderText="Loading content" />
10 <Skeleton width="66%" />
11 <Skeleton width="25%" />
12 <Skeleton width="50%" />
13 </Flex>
14 </CardBody>
15 <CardBody>
16 <Skeleton shape="square" width="75%" screenreaderText="Loading medium square contents" />
17 </CardBody>
18 <CardBody>
19 <Flex direction={{ default: 'column' }} spacer={{ default: 'spacerMd' }}>
20 <Skeleton screenreaderText="Loading content" />
21 <Skeleton width="25%" />
22 <Skeleton width="75%" />
23 <Skeleton width="50%" />
24 </Flex>
25 </CardBody>
26 </Card>
27 );
28 return (
29 <DashboardWrapper isBreadcrumbWidthLimited>
30 <PageSection isWidthLimited aria-label="main-title">
31 <Content component="h1" id="main-title">
32 Main title
33 </Content>
34 <Content component="p">This is a full page demo.</Content>
35 </PageSection>
36 <PageSection aria-label="Card gallery">
37 <Gallery hasGutter>{Array.from({ length: 7 }).map((_value, index) => card(index))}</Gallery>
38 </PageSection>
39 </DashboardWrapper>
40 );
41 };