-
Notifications
You must be signed in to change notification settings - Fork 14
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add component content header with status
- Loading branch information
1 parent
12945f2
commit a7c1878
Showing
6 changed files
with
157 additions
and
83 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import * as React from 'react' | ||
import MetadataContainer from '../containers/MetadataContainer' | ||
import BodyContainer from '../containers/BodyContainer' | ||
import SchemaContainer from '../containers/SchemaContainer' | ||
|
||
import { getComponentDisplayName, StatusDot } from './ComponentList' | ||
|
||
import { ComponentStatus } from '../models/store' | ||
|
||
interface DatasetComponentProps { | ||
component: string | ||
componentStatus: ComponentStatus | ||
history?: boolean | ||
} | ||
|
||
const DatasetComponent: React.FunctionComponent<DatasetComponentProps> = (props: DatasetComponentProps) => { | ||
const { component, componentStatus, history } = props | ||
let mainContent | ||
switch (component) { | ||
case 'meta': | ||
mainContent = <MetadataContainer history={history} /> | ||
break | ||
case 'body': | ||
mainContent = <BodyContainer history={history} /> | ||
break | ||
case 'schema': | ||
mainContent = <SchemaContainer history={history} /> | ||
break | ||
default: | ||
mainContent = <MetadataContainer history={history} /> | ||
} | ||
|
||
return ( | ||
<div className='component-container'> | ||
<div className='component-header'> | ||
<div className='component-display-name-container'> | ||
{getComponentDisplayName(component)} | ||
</div> | ||
<div className='status-dot-container'> | ||
{componentStatus && <StatusDot status={componentStatus.status} />} | ||
</div> | ||
</div> | ||
<div className='component-content'> | ||
{mainContent} | ||
</div> | ||
</div> | ||
) | ||
} | ||
|
||
export default DatasetComponent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters