fix: adds external link icon to empty prompt (#7324)
Added external link icon to prompt
This commit is contained in:
parent
76a1e56e06
commit
6f5b548960
1 changed files with 18 additions and 1 deletions
|
|
@ -1,3 +1,4 @@
|
||||||
|
import ForwardedIconComponent from "@/components/common/genericIconComponent";
|
||||||
import SanitizedHTMLWrapper from "@/components/common/sanitizedHTMLWrapper";
|
import SanitizedHTMLWrapper from "@/components/common/sanitizedHTMLWrapper";
|
||||||
import { regexHighlight } from "@/constants/constants";
|
import { regexHighlight } from "@/constants/constants";
|
||||||
import PromptModal from "@/modals/promptModal";
|
import PromptModal from "@/modals/promptModal";
|
||||||
|
|
@ -66,6 +67,19 @@ export default function PromptAreaComponent({
|
||||||
</span>
|
</span>
|
||||||
);
|
);
|
||||||
|
|
||||||
|
const renderExternalLinkIcon = () =>
|
||||||
|
!value || value == "" ? (
|
||||||
|
<ForwardedIconComponent
|
||||||
|
name={disabled ? "lock" : "Scan"}
|
||||||
|
className={cn(
|
||||||
|
"icons-parameters-comp pointer-events-none absolute right-3 top-1/2 h-4 w-4 shrink-0 -translate-y-1/2",
|
||||||
|
disabled ? "text-placeholder-foreground" : "text-foreground",
|
||||||
|
)}
|
||||||
|
/>
|
||||||
|
) : (
|
||||||
|
<></>
|
||||||
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn("w-full", disabled && "pointer-events-none")}>
|
<div className={cn("w-full", disabled && "pointer-events-none")}>
|
||||||
<PromptModal
|
<PromptModal
|
||||||
|
|
@ -82,7 +96,10 @@ export default function PromptAreaComponent({
|
||||||
className="w-full"
|
className="w-full"
|
||||||
data-testid="button_open_prompt_modal"
|
data-testid="button_open_prompt_modal"
|
||||||
>
|
>
|
||||||
<div className="relative w-full">{renderPromptText()}</div>
|
<div className="relative w-full">
|
||||||
|
{renderPromptText()}
|
||||||
|
{renderExternalLinkIcon()}
|
||||||
|
</div>
|
||||||
</Button>
|
</Button>
|
||||||
</PromptModal>
|
</PromptModal>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue