-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
f73f850
commit a94fcbd
Showing
1 changed file
with
27 additions
and
7 deletions.
There are no files selected for viewing
34 changes: 27 additions & 7 deletions
34
webview/src/experiments/components/emptyState/AddColumns.tsx
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 |
---|---|---|
@@ -1,10 +1,30 @@ | ||
import React from 'react' | ||
import { useSelector } from 'react-redux' | ||
import { selectColumns, toggleShowOnlyChanged } from '../../util/messages' | ||
import { ExperimentsState } from '../../store' | ||
import { StartButton } from '../../../shared/components/button/StartButton' | ||
import { selectColumns } from '../../util/messages' | ||
import { IconButton } from '../../../shared/components/button/IconButton' | ||
import { Close } from '../../../shared/components/icons' | ||
|
||
export const AddColumns: React.FC = () => ( | ||
<div> | ||
<p>No Columns Selected.</p> | ||
<StartButton onClick={selectColumns} text="Add Columns" /> | ||
</div> | ||
) | ||
export const AddColumns: React.FC = () => { | ||
const showOnlyChanged = useSelector( | ||
(state: ExperimentsState) => state.tableData.showOnlyChanged | ||
) | ||
return ( | ||
<div> | ||
<p>No Columns Selected.</p> | ||
<div> | ||
<StartButton onClick={selectColumns} text="Add Columns" /> | ||
{showOnlyChanged && ( | ||
<IconButton | ||
icon={Close} | ||
appearance="secondary" | ||
isNested={true} | ||
onClick={toggleShowOnlyChanged} | ||
text="Show Only Changed" | ||
/> | ||
)} | ||
</div> | ||
</div> | ||
) | ||
} |