feat: add Maison Work source type, rename ExternalMarket to Direktinserat, hide own portfolio from demand search by default

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Benjamin Sutter
2026-05-19 23:02:05 +02:00
parent a521155bb2
commit 3756675b6f
29 changed files with 115 additions and 42 deletions
+30 -6
View File
@@ -1,8 +1,8 @@
import { Box, Card, Chip, Divider, Stack, Typography } from '@mui/material'
import { Zap } from 'lucide-react'
import { Building2, Zap } from 'lucide-react'
import type { ResultType } from '../../domain/enums'
type FilterSource = Exclude<ResultType, 'FUTURE_AVAILABILITY'> | 'ALL'
type FilterSource = Exclude<ResultType, 'FUTURE_AVAILABILITY' | 'VERIFIED_PORTFOLIO'> | 'ALL'
type SortBy = 'score' | 'rent' | 'area'
interface Props {
@@ -12,12 +12,15 @@ interface Props {
onSortChange: (v: SortBy) => void
showSchattenmarkt: boolean
onShowSchattenmarktChange: (v: boolean) => void
showOwnProperties?: boolean
onShowOwnPropertiesChange?: (v: boolean) => void
isPropertyManager?: boolean
}
const FILTER_OPTIONS: { value: FilterSource; label: string; color: string }[] = [
{ value: 'ALL', label: 'Alle', color: '#1e3a5f' },
{ value: 'VERIFIED_PORTFOLIO', label: 'Portfolio', color: '#1e3a5f' },
{ value: 'EXTERNAL_MARKET', label: 'Marktinserate', color: '#d97706' },
{ value: 'ALL', label: 'Alle', color: '#1e3a5f' },
{ value: 'EXTERNAL_MARKET', label: 'Direktinserat', color: '#b45309' },
{ value: 'MAISON_WORK', label: 'Maison Work', color: '#0369a1' },
]
const SORT_OPTIONS: { value: SortBy; label: string }[] = [
@@ -33,11 +36,14 @@ export function ResultFilterBar({
onSortChange,
showSchattenmarkt,
onShowSchattenmarktChange,
showOwnProperties,
onShowOwnPropertiesChange,
isPropertyManager,
}: Props) {
return (
<Card sx={{ p: 1.5, mb: 2 }}>
<Box sx={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', flexWrap: 'wrap', gap: 1 }}>
{/* Source filter + Schattenmarkt toggle */}
{/* Source filter + toggles */}
<Box sx={{ display: 'flex', alignItems: 'center', flexWrap: 'wrap', gap: 0.5 }}>
<Stack direction="row" spacing={0.5} sx={{ flexWrap: 'wrap', gap: 0.5 }}>
{FILTER_OPTIONS.map(({ value, label, color }) => {
@@ -78,6 +84,24 @@ export function ResultFilterBar({
'& .MuiChip-icon': { ml: 0.75 },
}}
/>
{/* Eigene Objekte toggle — only for Property Managers */}
{isPropertyManager && (
<Chip
size="small"
clickable
icon={<Building2 size={11} color={showOwnProperties ? '#1e3a5f' : '#94a3b8'} />}
label="Eigene Objekte einblenden"
onClick={() => onShowOwnPropertiesChange?.(!showOwnProperties)}
sx={{
bgcolor: showOwnProperties ? 'rgba(30,58,95,0.10)' : 'transparent',
color: showOwnProperties ? '#1e3a5f' : 'text.disabled',
border: `1px solid ${showOwnProperties ? '#1e3a5f' : '#e2e8f0'}`,
fontWeight: showOwnProperties ? 600 : 400,
'& .MuiChip-icon': { ml: 0.75 },
}}
/>
)}
</Box>
{/* Sort */}
+2 -1
View File
@@ -3,7 +3,8 @@ import { Chip } from '@mui/material'
const TYPE_META: Record<string, { label: string; color: string }> = {
VERIFIED_PORTFOLIO: { label: 'Verified Portfolio', color: '#1e3a5f' },
EXTERNAL_MARKET: { label: 'Marktinserat', color: '#d97706' },
EXTERNAL_MARKET: { label: 'Direktinserat', color: '#d97706' },
MAISON_WORK: { label: 'Maison Work', color: '#0369a1' },
FUTURE_AVAILABILITY: { label: 'Zukunftssignal', color: '#7c3aed' },
}