fix: TypeScript errors — NominatimItem import, unknown ReactNode, unused deliveryType, effect generics, export name

This commit is contained in:
kirill.komarov
2026-05-13 22:16:00 +05:00
parent a06f9cf2c4
commit c6b542bd95
7 changed files with 12 additions and 14 deletions
@@ -14,7 +14,7 @@ import Typography from '@mui/material/Typography'
import * as maplibregl from 'maplibre-gl'
import Map, { Marker, type MapMouseEvent, type MapRef } from 'react-map-gl/maplibre'
import { reverseGeocode, searchPlaces } from '../api/map-geocoding'
import type { LatLng } from '../model/types'
import type { LatLng, NominatimItem } from '../model/types'
export function AddressMapPicker(props: {
value: { lat: number; lng: number } | null
@@ -8,14 +8,13 @@ import { PaymentDialog } from './PaymentDialog'
type Props = {
status: string
paymentMethod: string | null
deliveryType: string
totalCents: number
isPayPending: boolean
payError: unknown
onPay: (params: { detail: string; receiptFile: File | null }) => void
}
export function OrderPaymentSection({ status, paymentMethod, deliveryType, isPayPending, payError, onPay }: Props) {
export function OrderPaymentSection({ status, paymentMethod, isPayPending, payError, onPay }: Props) {
const payOnPickup = (paymentMethod ?? 'online') === 'on_pickup'
const [payModalOpen, setPayModalOpen] = useState(false)
@@ -127,11 +127,11 @@ export function PaymentDialog({ open, isPending, error, onClose, onSubmit }: Pro
{clientError}
</Alert>
)}
{error && (
{error ? (
<Alert severity="error" sx={{ mt: 1 }}>
{paySubmitErrorMessage(error)}
</Alert>
)}
) : null}
</DialogContent>
<DialogActions>
<Button onClick={handleClose} disabled={isPending}>
@@ -126,16 +126,16 @@ export function ReviewDialog({
}}
/>
)}
{uploadError && (
{uploadError ? (
<Alert severity="error" sx={{ mt: 2 }}>
Не удалось загрузить фото. Разрешены png, jpg, jpeg, webp.
</Alert>
)}
{error && (
) : null}
{error ? (
<Alert severity="error" sx={{ mt: 2 }}>
{reviewSubmitErrorMessage(error)}
</Alert>
)}
) : null}
</DialogContent>
<DialogActions>
<Button onClick={handleClose} disabled={isPending}>