diff options
author | srichman333 <sarah_n_richman@brown.edu> | 2023-08-24 17:52:10 -0400 |
---|---|---|
committer | srichman333 <sarah_n_richman@brown.edu> | 2023-08-24 17:52:10 -0400 |
commit | 88b26b5809a61f1e8041b0a6efa7635590f9438a (patch) | |
tree | b22137e66ca3c34c64bd21aeb7b23496c227f7da /src/client/views/nodes/generativeFill/GenerativeFillButtons.tsx | |
parent | d8b2b68e64f640d3bd84efa9d4095ab97991f315 (diff) | |
parent | 20e3d33d864f9ee9db2ca65848b0f42a087b699e (diff) |
Merge branch 'master' into data-visualization-sarah
Diffstat (limited to 'src/client/views/nodes/generativeFill/GenerativeFillButtons.tsx')
-rw-r--r-- | src/client/views/nodes/generativeFill/GenerativeFillButtons.tsx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/client/views/nodes/generativeFill/GenerativeFillButtons.tsx b/src/client/views/nodes/generativeFill/GenerativeFillButtons.tsx new file mode 100644 index 000000000..0dfcebea3 --- /dev/null +++ b/src/client/views/nodes/generativeFill/GenerativeFillButtons.tsx @@ -0,0 +1,42 @@ +import './GenerativeFillButtons.scss'; +import React = require('react'); +import ReactLoading from 'react-loading'; +import { activeColor } from './generativeFillUtils/generativeFillConstants'; +import { Button, Type } from 'browndash-components'; + +interface ButtonContainerProps { + getEdit: () => Promise<void>; + loading: boolean; + onReset: () => void; +} + +const Buttons = ({ loading, getEdit, onReset }: ButtonContainerProps) => { + return ( + <div className="generativeFillBtnContainer"> + <Button text="RESET" type={Type.PRIM} color={activeColor} onClick={onReset} /> + {loading ? ( + <Button + text="GET EDITS" + type={Type.TERT} + color={activeColor} + icon={<ReactLoading type="spin" color={'#ffffff'} width={20} height={20} />} + iconPlacement="right" + onClick={() => { + if (!loading) getEdit(); + }} + /> + ) : ( + <Button + text="GET EDITS" + type={Type.TERT} + color={activeColor} + onClick={() => { + if (!loading) getEdit(); + }} + /> + )} + </div> + ); +}; + +export default Buttons; |