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