Files
property-match/src/components/assistant/GlobalAIAssistantButton.tsx
T
Benjamin Sutter 5d53f35dea refactor(state): clean layoutStore, add selectors, centralise STALE constants
- layoutStore: remove 4 dead field groups (pinnedPanels, selectedResultId,
  compareTrayVisible, notificationsOpen) — none were read outside the store
- CompareTray: drop dead useLayoutStore side-effect (state was write-only)
- 8 components: replace bare useStore() with explicit selectors / useShallow
  to prevent unnecessary re-renders on unrelated state mutations
- lib/constants: add STALE_MARKET_SIGNALS + STALE_REVIEW_QUEUE (30s each)
- useMarketSignals, useReviewQueue: use global constants instead of
  hook-local magic numbers
- Add STATE_MANAGEMENT.md: decision tree + rules for RQ/Zustand/local/derived

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-24 01:30:44 +02:00

37 lines
943 B
TypeScript

import { Box, IconButton, Tooltip } from '@mui/material'
import { Sparkles } from 'lucide-react'
import { useAssistantStore } from '../../stores/assistantStore'
export function GlobalAIAssistantButton() {
const isOpen = useAssistantStore(s => s.isOpen)
const open = useAssistantStore(s => s.open)
return (
<Tooltip title="AI Assistent öffnen" placement="left">
<Box
sx={{
position: 'fixed',
bottom: 24,
right: 24,
zIndex: 1250,
display: isOpen ? 'none' : 'flex',
}}
>
<IconButton
onClick={open}
sx={{
width: 48,
height: 48,
bgcolor: '#4f46e5',
color: 'white',
boxShadow: '0 4px 16px rgba(79,70,229,0.4)',
'&:hover': { bgcolor: '#4338ca' },
}}
>
<Sparkles size={20} />
</IconButton>
</Box>
</Tooltip>
)
}