import { useState, useMemo, memo, useCallback } from 'react'; import { useRecoilValue } from 'recoil'; import { Atom, ChevronDown } from 'lucide-react'; import type { MouseEvent, FC } from 'react'; import { useLocalize } from '~/hooks'; import { cn } from '~/utils'; import store from '~/store'; const BUTTON_STYLES = { base: 'group mt-3 flex w-fit items-center justify-center rounded-xl bg-surface-tertiary px-3 py-2 text-xs leading-[18px] animate-thinking-appear', icon: 'icon-sm ml-1.5 transform-gpu text-text-primary transition-transform duration-200', } as const; const CONTENT_STYLES = { wrapper: 'relative pl-3 text-text-secondary', border: 'absolute left-0 h-[calc(100%-10px)] border-l-2 border-border-medium dark:border-border-heavy', partBorder: 'absolute left-0 h-[calc(100%)] border-l-2 border-border-medium dark:border-border-heavy', text: 'whitespace-pre-wrap leading-[26px]', } as const; export const ThinkingContent: FC<{ children: React.ReactNode; isPart?: boolean }> = memo( ({ isPart, children }) => (
{children}