From 67e4baf860096cad96cbe94a63391102451d13ff Mon Sep 17 00:00:00 2001 From: Benjamin Sutter Date: Fri, 15 May 2026 01:04:28 +0200 Subject: [PATCH] =?UTF-8?q?fix:=20TypeScript=20build=20errors=20(TS6=20enu?= =?UTF-8?q?m=20=E2=86=92=20const,=20MUI=20v9=20sx=20props,=20theme)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 4.6 --- src/components/ui/EmptyState.tsx | 2 +- src/components/ui/SectionContainer.tsx | 2 +- src/domain/enums.ts | 123 +++++++++++++------------ src/lib/theme.ts | 8 +- src/services/aiService.ts | 2 +- 5 files changed, 74 insertions(+), 63 deletions(-) diff --git a/src/components/ui/EmptyState.tsx b/src/components/ui/EmptyState.tsx index 8a388df..3a602fd 100644 --- a/src/components/ui/EmptyState.tsx +++ b/src/components/ui/EmptyState.tsx @@ -15,7 +15,7 @@ export function EmptyState({ icon, title, description, action }: EmptyStateProps return ( {icon && {icon}} - {title} + {title} {description && ( {description} )} diff --git a/src/components/ui/SectionContainer.tsx b/src/components/ui/SectionContainer.tsx index f77302e..a2c9d25 100644 --- a/src/components/ui/SectionContainer.tsx +++ b/src/components/ui/SectionContainer.tsx @@ -16,7 +16,7 @@ export function SectionContainer({ title, subtitle, action, children, className {(title || action) && ( - {title && {title}} + {title && {title}} {subtitle && {subtitle}} {action} diff --git a/src/domain/enums.ts b/src/domain/enums.ts index 8e62933..d73f10c 100644 --- a/src/domain/enums.ts +++ b/src/domain/enums.ts @@ -1,65 +1,74 @@ -export enum AssetType { - OFFICE = 'OFFICE', - RETAIL = 'RETAIL', - GASTRO = 'GASTRO', - LOGISTICS = 'LOGISTICS', - PRODUCTION = 'PRODUCTION', - MIXED = 'MIXED', -} +export const AssetType = { + OFFICE: 'OFFICE', + RETAIL: 'RETAIL', + GASTRO: 'GASTRO', + LOGISTICS: 'LOGISTICS', + PRODUCTION: 'PRODUCTION', + MIXED: 'MIXED', +} as const +export type AssetType = typeof AssetType[keyof typeof AssetType] -export enum ResultType { - VERIFIED_PORTFOLIO = 'VERIFIED_PORTFOLIO', - EXTERNAL_MARKET = 'EXTERNAL_MARKET', - FUTURE_AVAILABILITY = 'FUTURE_AVAILABILITY', -} +export const ResultType = { + VERIFIED_PORTFOLIO: 'VERIFIED_PORTFOLIO', + EXTERNAL_MARKET: 'EXTERNAL_MARKET', + FUTURE_AVAILABILITY: 'FUTURE_AVAILABILITY', +} as const +export type ResultType = typeof ResultType[keyof typeof ResultType] -export enum MatchStrength { - STRONG = 'STRONG', - MODERATE = 'MODERATE', - WEAK = 'WEAK', -} +export const MatchStrength = { + STRONG: 'STRONG', + MODERATE: 'MODERATE', + WEAK: 'WEAK', +} as const +export type MatchStrength = typeof MatchStrength[keyof typeof MatchStrength] -export enum RiskLevel { - LOW = 'LOW', - MEDIUM = 'MEDIUM', - HIGH = 'HIGH', - CRITICAL = 'CRITICAL', -} +export const RiskLevel = { + LOW: 'LOW', + MEDIUM: 'MEDIUM', + HIGH: 'HIGH', + CRITICAL: 'CRITICAL', +} as const +export type RiskLevel = typeof RiskLevel[keyof typeof RiskLevel] -export enum AvailabilityStatus { - AVAILABLE_NOW = 'AVAILABLE_NOW', - AVAILABLE_SOON = 'AVAILABLE_SOON', - FUTURE_SIGNAL = 'FUTURE_SIGNAL', - OCCUPIED = 'OCCUPIED', - UNKNOWN = 'UNKNOWN', -} +export const AvailabilityStatus = { + AVAILABLE_NOW: 'AVAILABLE_NOW', + AVAILABLE_SOON: 'AVAILABLE_SOON', + FUTURE_SIGNAL: 'FUTURE_SIGNAL', + OCCUPIED: 'OCCUPIED', + UNKNOWN: 'UNKNOWN', +} as const +export type AvailabilityStatus = typeof AvailabilityStatus[keyof typeof AvailabilityStatus] -export enum DataFreshness { - FRESH = 'FRESH', - STALE = 'STALE', - OUTDATED = 'OUTDATED', -} +export const DataFreshness = { + FRESH: 'FRESH', + STALE: 'STALE', + OUTDATED: 'OUTDATED', +} as const +export type DataFreshness = typeof DataFreshness[keyof typeof DataFreshness] -export enum UserRole { - SUPER_ADMIN = 'SUPER_ADMIN', - ORGANIZATION_ADMIN = 'ORGANIZATION_ADMIN', - PROPERTY_MANAGER = 'PROPERTY_MANAGER', - REVIEWER = 'REVIEWER', - OWNER_VIEWER = 'OWNER_VIEWER', - DEMAND_USER = 'DEMAND_USER', -} +export const UserRole = { + SUPER_ADMIN: 'SUPER_ADMIN', + ORGANIZATION_ADMIN: 'ORGANIZATION_ADMIN', + PROPERTY_MANAGER: 'PROPERTY_MANAGER', + REVIEWER: 'REVIEWER', + OWNER_VIEWER: 'OWNER_VIEWER', + DEMAND_USER: 'DEMAND_USER', +} as const +export type UserRole = typeof UserRole[keyof typeof UserRole] -export enum SignalType { - EXPANSION = 'EXPANSION', - POSSIBLE_MOVE_OUT = 'POSSIBLE_MOVE_OUT', - CONSTRUCTION_PROJECT = 'CONSTRUCTION_PROJECT', - RESTRUCTURING = 'RESTRUCTURING', - PROJECT_DEVELOPMENT = 'PROJECT_DEVELOPMENT', - SPACE_CONSOLIDATION = 'SPACE_CONSOLIDATION', -} +export const SignalType = { + EXPANSION: 'EXPANSION', + POSSIBLE_MOVE_OUT: 'POSSIBLE_MOVE_OUT', + CONSTRUCTION_PROJECT: 'CONSTRUCTION_PROJECT', + RESTRUCTURING: 'RESTRUCTURING', + PROJECT_DEVELOPMENT: 'PROJECT_DEVELOPMENT', + SPACE_CONSOLIDATION: 'SPACE_CONSOLIDATION', +} as const +export type SignalType = typeof SignalType[keyof typeof SignalType] -export enum WorkspaceType { - SUPPLY = 'SUPPLY', - DEMAND = 'DEMAND', - OPERATIONS = 'OPERATIONS', -} +export const WorkspaceType = { + SUPPLY: 'SUPPLY', + DEMAND: 'DEMAND', + OPERATIONS: 'OPERATIONS', +} as const +export type WorkspaceType = typeof WorkspaceType[keyof typeof WorkspaceType] diff --git a/src/lib/theme.ts b/src/lib/theme.ts index 915fc70..be22b6c 100644 --- a/src/lib/theme.ts +++ b/src/lib/theme.ts @@ -79,9 +79,11 @@ export const theme = createTheme({ defaultProps: { disableElevation: true }, styleOverrides: { root: { borderRadius: 6, padding: '6px 16px' }, - containedPrimary: { - background: '#1e3a5f', - '&:hover': { background: '#142a45' }, + contained: { + '&.MuiButton-containedPrimary': { + background: '#1e3a5f', + '&:hover': { background: '#142a45' }, + }, }, }, }, diff --git a/src/services/aiService.ts b/src/services/aiService.ts index 098aad3..0fb8867 100644 --- a/src/services/aiService.ts +++ b/src/services/aiService.ts @@ -15,7 +15,7 @@ export interface AIServiceProvider { } const MockupAIServiceProvider: AIServiceProvider = { - async extractCriteria(input: string): Promise { + async extractCriteria(_input: string): Promise { // Deterministic mock extraction — simulates AI parsing return { extractedCriteria: {