|
| 1 | +import React from 'react'; |
| 2 | +import { |
| 3 | + DescriptionList, |
| 4 | + DescriptionListTerm, |
| 5 | + DescriptionListGroup, |
| 6 | + DescriptionListDescription, |
| 7 | + Divider, |
| 8 | + Brand, |
| 9 | +} from '@patternfly/react-core'; |
| 10 | +import { WorkspaceKind } from '~/shared/api/backendApiTypes'; |
| 11 | + |
| 12 | +type WorkspaceDetailsOverviewProps = { |
| 13 | + workspaceKind: WorkspaceKind; |
| 14 | +}; |
| 15 | + |
| 16 | +export const WorkspaceDetailsOverview: React.FunctionComponent<WorkspaceDetailsOverviewProps> = ({ |
| 17 | + workspaceKind, |
| 18 | +}) => ( |
| 19 | + <DescriptionList isHorizontal> |
| 20 | + <DescriptionListGroup> |
| 21 | + <DescriptionListTerm>Name</DescriptionListTerm> |
| 22 | + <DescriptionListDescription>{workspaceKind.name}</DescriptionListDescription> |
| 23 | + </DescriptionListGroup> |
| 24 | + <Divider /> |
| 25 | + <DescriptionListGroup> |
| 26 | + <DescriptionListTerm>Description</DescriptionListTerm> |
| 27 | + <DescriptionListDescription>{workspaceKind.description}</DescriptionListDescription> |
| 28 | + </DescriptionListGroup> |
| 29 | + <Divider /> |
| 30 | + |
| 31 | + <DescriptionListGroup> |
| 32 | + <DescriptionListTerm>Hidden</DescriptionListTerm> |
| 33 | + <DescriptionListDescription>{workspaceKind.hidden ? 'Yes' : 'No'}</DescriptionListDescription> |
| 34 | + </DescriptionListGroup> |
| 35 | + <Divider /> |
| 36 | + <DescriptionListGroup> |
| 37 | + <DescriptionListTerm>Status</DescriptionListTerm> |
| 38 | + <DescriptionListDescription> |
| 39 | + {workspaceKind.deprecated ? 'Deprecated' : 'Active'} |
| 40 | + </DescriptionListDescription> |
| 41 | + </DescriptionListGroup> |
| 42 | + <Divider /> |
| 43 | + <DescriptionListGroup> |
| 44 | + <DescriptionListTerm>Deprecation Message</DescriptionListTerm> |
| 45 | + <DescriptionListDescription>{workspaceKind.deprecationMessage}</DescriptionListDescription> |
| 46 | + </DescriptionListGroup> |
| 47 | + <Divider /> |
| 48 | + <DescriptionListGroup> |
| 49 | + <DescriptionListTerm style={{ alignSelf: 'center' }}>Icon</DescriptionListTerm> |
| 50 | + <DescriptionListDescription> |
| 51 | + <Brand src={workspaceKind.icon.url} alt={workspaceKind.name} style={{ width: '40px' }} /> |
| 52 | + </DescriptionListDescription> |
| 53 | + <DescriptionListTerm style={{ alignSelf: 'center' }}>Icon URL</DescriptionListTerm> |
| 54 | + <DescriptionListDescription> |
| 55 | + <a href={workspaceKind.icon.url} target="_blank" rel="noreferrer"> |
| 56 | + {workspaceKind.icon.url} |
| 57 | + </a> |
| 58 | + </DescriptionListDescription> |
| 59 | + </DescriptionListGroup> |
| 60 | + <Divider /> |
| 61 | + <DescriptionListGroup> |
| 62 | + <DescriptionListTerm style={{ alignSelf: 'center' }}>Logo</DescriptionListTerm> |
| 63 | + <DescriptionListDescription> |
| 64 | + <Brand src={workspaceKind.logo.url} alt={workspaceKind.name} style={{ width: '40px' }} /> |
| 65 | + </DescriptionListDescription> |
| 66 | + <DescriptionListTerm style={{ alignSelf: 'center' }}>Logo URL</DescriptionListTerm> |
| 67 | + <DescriptionListDescription> |
| 68 | + <a href={workspaceKind.icon.url} target="_blank" rel="noreferrer"> |
| 69 | + {workspaceKind.logo.url} |
| 70 | + </a> |
| 71 | + </DescriptionListDescription> |
| 72 | + </DescriptionListGroup> |
| 73 | + </DescriptionList> |
| 74 | +); |
0 commit comments