show ai link in header
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled

This commit is contained in:
hamid zarghami
2026-07-29 09:41:09 +03:30
parent b19c1cd3ca
commit 2248845467
2 changed files with 116 additions and 30 deletions
+32 -30
View File
@@ -1,38 +1,40 @@
'use client'
"use client";
import React from 'react'
import SearchIcon from '../icons/SearchIcon'
import { glassSurfaceFlat } from '@/lib/styles/glassSurface'
import { useGetAbout } from "@/app/[name]/(Main)/about/hooks/useAboutData";
import { glassSurfaceFlat } from "@/lib/styles/glassSurface";
import Link from "next/link";
import { useParams } from "next/navigation";
import React from "react";
import SearchIcon from "../icons/SearchIcon";
interface SearchboxProps
extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'results'> {
placeholder?: string
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void
interface SearchboxProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, "results"> {
placeholder?: string;
onChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
}
export default function SearchBox({
className,
value,
placeholder = '',
onChange,
...props
}: SearchboxProps) {
export default function SearchBox({ className, value, placeholder = "", onChange, ...props }: SearchboxProps) {
const { name } = useParams<{ name?: string }>();
const { data: about } = useGetAbout();
const showAiLink = !!name && !!about?.data?.enableAiChat;
return (
<div
className={glassSurfaceFlat(
'inline-flex rounded-xl px-4 h-10 w-full items-center content-center',
className,
<div className="flex gap-4 items-center">
<div className={glassSurfaceFlat("inline-flex rounded-xl px-4 h-10 w-full items-center content-center", className)}>
<SearchIcon stroke="#8C90A3" />
<input
onChange={onChange}
value={value}
placeholder={placeholder}
className="text-[#8C90A3] pt-1 block outline-none border-none focus:ring-0 focus:outline-none px-[7px] h-full items-center w-full text-xs!"
type="search"
{...props}
/>
</div>
{showAiLink && (
<Link href={`/${name}/ai`} aria-label="AI">
<img src={"/assets/images/logo_ai2.svg"} alt="logo_ai" className="w-6" />
</Link>
)}
>
<SearchIcon stroke='#8C90A3' />
<input
onChange={onChange}
value={value}
placeholder={placeholder}
className='text-[#8C90A3] pt-1 block outline-none border-none focus:ring-0 focus:outline-none px-[7px] h-full items-center w-full text-xs!'
type='search'
{...props}
/>
</div>
)
);
}