33import { useCallback , useEffect , useRef , useState } from 'react'
44import { createLogger } from '@sim/logger'
55import { useParams , useRouter } from 'next/navigation'
6- import { Loader } from '@/components/emcn'
76import { useSession } from '@/lib/auth/auth-client'
87import {
98 LandingPromptStorage ,
@@ -19,6 +18,27 @@ import { useChat } from './hooks'
1918
2019const logger = createLogger ( 'Home' )
2120
21+ const THINKING_BLOCKS = [
22+ { color : '#2ABBF8' , delay : '0s' } ,
23+ { color : '#00F701' , delay : '0.2s' } ,
24+ { color : '#FA4EDF' , delay : '0.6s' } ,
25+ { color : '#FFCC02' , delay : '0.4s' } ,
26+ ] as const
27+
28+ function ThinkingIndicator ( ) {
29+ return (
30+ < div className = 'grid h-[16px] w-[16px] grid-cols-2 gap-[1.5px]' >
31+ { THINKING_BLOCKS . map ( ( block , i ) => (
32+ < div
33+ key = { i }
34+ className = 'animate-thinking-block rounded-[2px]'
35+ style = { { backgroundColor : block . color , animationDelay : block . delay } }
36+ />
37+ ) ) }
38+ </ div >
39+ )
40+ }
41+
2242interface HomeProps {
2343 chatId ?: string
2444}
@@ -178,7 +198,7 @@ export function Home({ chatId }: HomeProps = {}) {
178198 if ( ! hasBlocks && ! msg . content && isThisStreaming ) {
179199 return (
180200 < div key = { msg . id } className = 'flex items-center gap-[8px] py-[8px]' >
181- < Loader className = 'h-[16px] w-[16px] text-[var(--text-icon)]' animate />
201+ < ThinkingIndicator />
182202 < span className = 'font-[var(--sidebar-font-weight)] text-[14px] text-[var(--text-body)]' >
183203 Thinking…
184204 </ span >
0 commit comments