diff options
author | bobzel <zzzman@gmail.com> | 2023-08-26 15:52:04 -0400 |
---|---|---|
committer | bobzel <zzzman@gmail.com> | 2023-08-26 15:52:04 -0400 |
commit | 8f43a98c363ff541070b100a2d4e10e505df6969 (patch) | |
tree | d7bd88f2c2d44e7eb6d9f1b102923b47617cb169 /src/client/views/nodes/generativeFill/GenerativeFillButtons.tsx | |
parent | 2c46608d3207a8463907b0e1904d9b3026d6d1c8 (diff) | |
parent | 603e437d4964c2f104a04f4f977802e241347344 (diff) |
Merge branch 'master' into UI_Update_Eric_Ma
Diffstat (limited to 'src/client/views/nodes/generativeFill/GenerativeFillButtons.tsx')
-rw-r--r-- | src/client/views/nodes/generativeFill/GenerativeFillButtons.tsx | 44 |
1 files changed, 44 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..10eca358e --- /dev/null +++ b/src/client/views/nodes/generativeFill/GenerativeFillButtons.tsx @@ -0,0 +1,44 @@ +import './GenerativeFillButtons.scss'; +import React = require('react'); +import ReactLoading from 'react-loading'; +import { activeColor } from './generativeFillUtils/generativeFillConstants'; +import { Button, IconButton, Type } from 'browndash-components'; +import { AiOutlineInfo } from 'react-icons/ai'; + +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(); + }} + /> + )} + <IconButton type={Type.SEC} color={activeColor} tooltip="Open Documentation" icon={<AiOutlineInfo size={'16px'} />} onClick={() => window.open('https://brown-dash.github.io/Dash-Documentation/features/generativeai/#editing', '_blank')} /> + </div> + ); +}; + +export default Buttons; |