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}>
|
||||
|
||||
@@ -207,8 +207,7 @@ export function OrderDetailPage() {
|
||||
|
||||
<OrderPaymentSection
|
||||
status={order.status}
|
||||
paymentMethod={order.paymentMethod}
|
||||
deliveryType={order.deliveryType}
|
||||
paymentMethod={order.paymentMethod ?? null}
|
||||
totalCents={order.totalCents}
|
||||
isPayPending={payMut.isPending}
|
||||
payError={payMut.error}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { createEffect, createEvent, createStore } from 'effector'
|
||||
import { createEvent, createStore, type Effect } from 'effector'
|
||||
|
||||
export function createErrorStore<Fx extends ReturnType<typeof createEffect>>(fx: Fx) {
|
||||
export function createErrorStore(fx: Effect<any, any, any>) {
|
||||
const reset = createEvent()
|
||||
const $error = createStore<unknown | null>(null)
|
||||
.on(fx.failData, (_, e) => e)
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
export { AdminTable } from './AdminTable'
|
||||
export type { Column as AdminTableColumn } from './AdminTable'
|
||||
export type { AdminTableColumn } from './AdminTable'
|
||||
|
||||
Reference in New Issue
Block a user