diff --git a/packages/gitbook/src/components/AIChat/AIChatIcon.tsx b/packages/gitbook/src/components/AIChat/AIChatIcon.tsx index a4cf051540..93f8cf9a22 100644 --- a/packages/gitbook/src/components/AIChat/AIChatIcon.tsx +++ b/packages/gitbook/src/components/AIChat/AIChatIcon.tsx @@ -1,4 +1,3 @@ -import { tcls } from '@/lib/tailwind'; import { Icon, IconStyle } from '@gitbook/icons'; import type React from 'react'; @@ -21,12 +20,18 @@ export function AIChatIcon({ ); } @@ -50,28 +55,36 @@ export function AIChatIcon({ {/* Error */} {/* Confirm */} - {/* Background */} + {/* Background */} {/* Logo */} @@ -154,45 +182,65 @@ export function AIChatIcon({ strokeWidth="1.2" strokeLinecap="round" strokeLinejoin="round" - className={tcls( - (state === 'thinking' || state === 'working') && - 'animate-[pathLoading_2s_infinite_both]', - state === 'intro' && 'animate-[pathEnter_2s_both]', - state === 'done' && 'animate-[pathEnter_1s_forwards_ease]' - )} + style={{ + animation: { + intro: 'pathEnter 1.5s both ease-out', + thinking: 'pathLoading 2s infinite both', + working: 'pathLoading 2s infinite both', + done: 'pathEnter 1s forwards ease', + confirm: '', + default: '', + error: '', + }[state], + }} /> ); } -export function AISearchIcon({ - className = 'size-4', - state = 'default', -}: Pick) { +interface AISearchIconProps extends React.SVGProps { + className?: string; + state?: 'default' | 'intro' | 'thinking' | 'working' | 'done' | 'error' | 'confirm'; +} + +export function AISearchIcon({ className = 'size-4', state = 'default' }: AISearchIconProps) { return (
);