mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-03 05:29:12 +00:00
Make cursor in chat input take on selected agent color
This commit is contained in:
@@ -42,6 +42,13 @@ export function converColorToBgGradient(color: string) {
|
||||
return `${convertToBGGradientClass(color)} dark:border dark:border-neutral-700`;
|
||||
}
|
||||
|
||||
export function convertColorToCaretClass(color: string | undefined) {
|
||||
if (color && tailwindColors.includes(color)) {
|
||||
return `caret-${color}-500`;
|
||||
}
|
||||
return `caret-orange-500`;
|
||||
}
|
||||
|
||||
export function convertColorToRingClass(color: string | undefined) {
|
||||
if (color && tailwindColors.includes(color)) {
|
||||
return `focus-visible:ring-${color}-500`;
|
||||
|
||||
@@ -37,7 +37,11 @@ import { Popover, PopoverContent } from "@/components/ui/popover";
|
||||
import { PopoverTrigger } from "@radix-ui/react-popover";
|
||||
import { Textarea } from "@/components/ui/textarea";
|
||||
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "@/components/ui/tooltip";
|
||||
import { convertColorToTextClass, convertToBGClass } from "@/app/common/colorUtils";
|
||||
import {
|
||||
convertColorToCaretClass,
|
||||
convertColorToTextClass,
|
||||
convertToBGClass,
|
||||
} from "@/app/common/colorUtils";
|
||||
|
||||
import LoginPrompt from "../loginPrompt/loginPrompt";
|
||||
import { uploadDataForIndexing } from "../../common/chatFunctions";
|
||||
@@ -494,8 +498,8 @@ export const ChatInputArea = forwardRef<HTMLTextAreaElement, ChatInputProps>((pr
|
||||
</div>
|
||||
<Textarea
|
||||
ref={chatInputRef}
|
||||
className={`border-none focus:border-none
|
||||
focus:outline-none focus-visible:ring-transparent
|
||||
className={`border-none focus:border-none focus:outline-none focus-visible:ring-transparent
|
||||
animate-carate-blink ${convertColorToCaretClass(props.agentColor)}
|
||||
w-full h-16 min-h-16 max-h-[128px] md:py-4 rounded-lg resize-none dark:bg-neutral-700
|
||||
${props.isMobileWidth ? "text-md" : "text-lg"}`}
|
||||
placeholder="Type / to see a list of commands"
|
||||
|
||||
Reference in New Issue
Block a user