feat: fix sight edit
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { MEDIA_TYPE_LABELS, editSightStore } from "@shared";
|
||||
import { MEDIA_TYPE_LABELS, MEDIA_TYPE_VALUES, editSightStore } from "@shared";
|
||||
import { observer } from "mobx-react-lite";
|
||||
import { useEffect, useState } from "react";
|
||||
import {
|
||||
@@ -31,6 +31,7 @@ interface UploadMediaDialogProps {
|
||||
media_type: number;
|
||||
}) => void;
|
||||
afterUploadSight?: (id: string) => void;
|
||||
hardcodeType?: "thumbnail" | "watermark_lu" | "watermark_rd" | null;
|
||||
}
|
||||
|
||||
export const UploadMediaDialog = observer(
|
||||
@@ -39,6 +40,7 @@ export const UploadMediaDialog = observer(
|
||||
onClose,
|
||||
afterUpload,
|
||||
afterUploadSight,
|
||||
hardcodeType,
|
||||
}: UploadMediaDialogProps) => {
|
||||
const [isLoading, setIsLoading] = useState(false);
|
||||
const [error, setError] = useState<string | null>(null);
|
||||
@@ -165,10 +167,12 @@ export const UploadMediaDialog = observer(
|
||||
<FormControl fullWidth sx={{ width: "50%" }}>
|
||||
<InputLabel>Тип медиа</InputLabel>
|
||||
<Select
|
||||
value={mediaType}
|
||||
value={
|
||||
hardcodeType ? MEDIA_TYPE_VALUES[hardcodeType] : mediaType
|
||||
}
|
||||
disabled={!!hardcodeType}
|
||||
label="Тип медиа"
|
||||
onChange={(e) => setMediaType(Number(e.target.value))}
|
||||
disabled={isLoading}
|
||||
>
|
||||
{availableMediaTypes.map((type) => (
|
||||
<MenuItem key={type} value={type}>
|
||||
|
||||
Reference in New Issue
Block a user