|
|
|
@ -3,7 +3,7 @@ import { FeedbackAlertProps } from '../types' |
|
|
|
|
import { RenderIf } from '@remix-ui/helper' |
|
|
|
|
import {CopyToClipboard} from '@remix-ui/clipboard' |
|
|
|
|
|
|
|
|
|
export function FeedbackAlert ({ message, location, askGPT }: FeedbackAlertProps) { |
|
|
|
|
export function FeedbackAlert ({ message, askGPT }: FeedbackAlertProps) { |
|
|
|
|
const [ showAlert, setShowAlert] = useState<boolean>(true) |
|
|
|
|
|
|
|
|
|
const handleCloseAlert = () => { |
|
|
|
@ -14,9 +14,6 @@ export function FeedbackAlert ({ message, location, askGPT }: FeedbackAlertProps |
|
|
|
|
<RenderIf condition={showAlert}> |
|
|
|
|
<> |
|
|
|
|
<span> { message } </span> |
|
|
|
|
<RenderIf condition={location !== null}> |
|
|
|
|
<span> { location }</span> |
|
|
|
|
</RenderIf> |
|
|
|
|
<div className="close" data-id="renderer" onClick={handleCloseAlert}> |
|
|
|
|
<i className="fas fa-times"></i> |
|
|
|
|
</div> |
|
|
|
@ -24,7 +21,10 @@ export function FeedbackAlert ({ message, location, askGPT }: FeedbackAlertProps |
|
|
|
|
<span className="ml-3 pt-1 py-1" > |
|
|
|
|
<CopyToClipboard content={message} className="p-0 m-0 far fa-copy error" direction={'top'} /> |
|
|
|
|
</span> |
|
|
|
|
<span className="border border-success text-success btn-sm" onClick={askGPT}>ASK GPT</span> |
|
|
|
|
<span className="border border-success text-success btn-sm" onClick={(e) => { |
|
|
|
|
e.stopPropagation() |
|
|
|
|
askGPT() |
|
|
|
|
}}>ASK GPT</span> |
|
|
|
|
</div> |
|
|
|
|
</> |
|
|
|
|
</RenderIf> |
|
|
|
|