fix: TypeScript errors — NominatimItem import, unknown ReactNode, unused deliveryType, effect generics, export name
This commit is contained in:
@@ -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}>
|
||||
|
||||
Reference in New Issue
Block a user