Skip to content

Commit

Permalink
create customized example
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolethoen committed Nov 19, 2024
1 parent 9f193bf commit 4f2efcd
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,20 @@ propComponents: ['EmptyStateErrorMessage']
---

import { EmptyStateErrorMessage } from "@patternfly/ai-infra-ui-components";
import { DrumstickBiteIcon } from '@patternfly/react-icons';

Note: this component documents the API and enhances the [existing EmptyStateErrorMessage](https://github.com/opendatahub-io/odh-dashboard/blob/main/frontend/src/components/EmptyStateErrorMessage.tsx) component from odh-dashboard. It can be imported from [@patternfly/ai-infra-ui-components](https://www.npmjs.com/package/@patternfly/AI-infra-ui-components). Alternatively, it can be used within the odh-dashboard via the import: `~/components/EmptyStateErrorMessage`

### Example
### Basic

```js file="./EmptyStateErrorMessageBasic.tsx"

```

### Customization

All properties of PatternFly's [empty state component](https://www.patternfly.org/components/empty-state) are spread to the error state component group.

```js file="./EmptyStateErrorMessageCustomized.tsx"

```
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import * as React from 'react';
import { EmptyStateErrorMessage } from "@patternfly/ai-infra-ui-components";
import { DrumstickBiteIcon } from '@patternfly/react-icons';

export const EmptyStateErrorMessageBasic: React.FunctionComponent = () => (
<EmptyStateErrorMessage
title="Error loading workloads"
bodyText="Check your network connection."
icon={DrumstickBiteIcon}
headingLevel="h3"
status="info"
/>
);

0 comments on commit 4f2efcd

Please sign in to comment.