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:
@@ -48,7 +48,7 @@ const DEFAULT_CONFIG: HotelConfig = {
|
|||||||
|
|
||||||
export function GuestReviewPage() {
|
export function GuestReviewPage() {
|
||||||
const { slug } = useParams<{ slug: string }>()
|
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 [rating, setRating] = useState(0)
|
||||||
const [hover, setHover] = useState(0)
|
const [hover, setHover] = useState(0)
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ const PURPOSE_LABELS: Record<ChargePurpose, string> = {
|
|||||||
extra: 'Доп. услуга',
|
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: 'stay', label: 'Проживание', amount: null, Icon: Building2 },
|
||||||
{ purpose: 'breakfast', label: 'Завтрак', amount: 650, Icon: Coffee },
|
{ purpose: 'breakfast', label: 'Завтрак', amount: 650, Icon: Coffee },
|
||||||
{ purpose: 'transfer', label: 'Трансфер', amount: 2500, Icon: Car },
|
{ 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 balance = selectedRoom ? Math.max(0, selectedRoom.totalAmount - selectedRoom.paidAmount) : 0
|
||||||
const isPaid = selectedRoom ? selectedRoom.paidAmount >= selectedRoom.totalAmount : false
|
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: 'main', label: 'Касса', Icon: Receipt },
|
||||||
{ key: 'report', label: 'X/Z-отчёт', Icon: BarChart2 },
|
{ key: 'report', label: 'X/Z-отчёт', Icon: BarChart2 },
|
||||||
{ key: 'atol', label: 'АТОЛ', Icon: Settings2 },
|
{ key: 'atol', label: 'АТОЛ', Icon: Settings2 },
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ export function ReviewsPage() {
|
|||||||
return null
|
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: 'pending', label: 'Требуют ответа', count: pending.length, colorCls: 'bg-red-500 text-white' },
|
||||||
{ key: 'published', label: 'Архив', count: published.length },
|
{ key: 'published', label: 'Архив', count: published.length },
|
||||||
{ key: 'all', label: 'Все' },
|
{ key: 'all', label: 'Все' },
|
||||||
|
|||||||
Reference in New Issue
Block a user