import { useNavigate, useLocation } from 'react-router' import { Box, Button, IconButton, Typography } from '@mui/material' import { X } from 'lucide-react' import { useCompareStore } from '../../stores/compareStore' const TYPE_DOT: Record = { VERIFIED_PORTFOLIO: '#152642', MAISON_WORK: '#0369a1', FUTURE_AVAILABILITY: '#7c3aed', } export function CompareTray() { const { compareItems, removeFromCompare, clearCompare } = useCompareStore() const navigate = useNavigate() const location = useLocation() const isDemand = location.pathname.startsWith('/demand') if (!isDemand) return null const getTitle = (item: (typeof compareItems)[number]) => { if (item.resultType === 'FUTURE_AVAILABILITY') { return (item as any).signal?.companyName ?? (item as any).signal?.locationHint ?? 'Signal' } return (item as any).property?.title ?? `Score ${item.matchScore}` } return ( 0 ? 'translateY(0)' : 'translateY(100%)', transition: 'transform 0.25s ease', }} > Vergleich ({compareItems.length}/4) {compareItems.map((item) => ( {getTitle(item)} {item.matchScore} removeFromCompare(item.matchId)} sx={{ p: 0.25, color: 'rgba(255,255,255,0.5)', '&:hover': { color: '#fff' } }} > ))} ) }