Fix TypeScript build errors

- GuestReviewPage: fix hotel config lookup type (slug && obj returns '' | obj)
- PosPage, ReviewsPage: change ComponentType<{size?:number}> to ElementType for Lucide icon compatibility

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-16 19:43:20 +03:00
parent dc3e68dbe2
commit 26da3eafa8
3 changed files with 4 additions and 4 deletions

View File

@@ -48,7 +48,7 @@ const DEFAULT_CONFIG: HotelConfig = {
export function GuestReviewPage() {
const { slug } = useParams<{ slug: string }>()
const hotel = (slug && MOCK_HOTELS[slug]) ?? DEFAULT_CONFIG
const hotel: HotelConfig = (slug ? MOCK_HOTELS[slug] : null) ?? DEFAULT_CONFIG
const [rating, setRating] = useState(0)
const [hover, setHover] = useState(0)

View File

@@ -56,7 +56,7 @@ const PURPOSE_LABELS: Record<ChargePurpose, string> = {
extra: 'Доп. услуга',
}
const QUICK_CHARGES: { purpose: ChargePurpose; label: string; amount: number | null; Icon: React.ComponentType<{ size?: number }> }[] = [
const QUICK_CHARGES: { purpose: ChargePurpose; label: string; amount: number | null; Icon: React.ElementType }[] = [
{ purpose: 'stay', label: 'Проживание', amount: null, Icon: Building2 },
{ purpose: 'breakfast', label: 'Завтрак', amount: 650, Icon: Coffee },
{ purpose: 'transfer', label: 'Трансфер', amount: 2500, Icon: Car },
@@ -193,7 +193,7 @@ export function PosPage() {
const balance = selectedRoom ? Math.max(0, selectedRoom.totalAmount - selectedRoom.paidAmount) : 0
const isPaid = selectedRoom ? selectedRoom.paidAmount >= selectedRoom.totalAmount : false
const TABS: { key: PosTab; label: string; Icon: React.ComponentType<{ size?: number }> }[] = [
const TABS: { key: PosTab; label: string; Icon: React.ElementType }[] = [
{ key: 'main', label: 'Касса', Icon: Receipt },
{ key: 'report', label: 'X/Z-отчёт', Icon: BarChart2 },
{ key: 'atol', label: 'АТОЛ', Icon: Settings2 },

View File

@@ -220,7 +220,7 @@ export function ReviewsPage() {
return null
}
const TABS: { key: Tab; label: string; count?: number; colorCls?: string; Icon?: React.ComponentType<{ size?: number }> }[] = [
const TABS: { key: Tab; label: string; count?: number; colorCls?: string; Icon?: React.ElementType }[] = [
{ key: 'pending', label: 'Требуют ответа', count: pending.length, colorCls: 'bg-red-500 text-white' },
{ key: 'published', label: 'Архив', count: published.length },
{ key: 'all', label: 'Все' },