diff --git a/src/lib/constants.ts b/src/lib/constants.ts index d50da64..d43ed3b 100644 --- a/src/lib/constants.ts +++ b/src/lib/constants.ts @@ -1 +1,6 @@ export const BACKEND_URL = 'https://wn.krbl.ru' + +export const MEDIA_TYPES = [ + {label: 'Фото', value: 1}, + {label: 'Видео', value: 2}, +] diff --git a/src/pages/media/create.tsx b/src/pages/media/create.tsx index b4ac0bf..00543f0 100644 --- a/src/pages/media/create.tsx +++ b/src/pages/media/create.tsx @@ -1,8 +1,10 @@ -import {Box, TextField, Button, Typography} from '@mui/material' +import {Box, TextField, Button, Typography, FormControl, InputLabel, Select, MenuItem} from '@mui/material' import {Create} from '@refinedev/mui' import {useForm} from '@refinedev/react-hook-form' import {useState} from 'react' +import {MEDIA_TYPES} from '../../lib/constants' + export const MediaCreate = () => { const { saveButtonProps, @@ -88,20 +90,28 @@ export const MediaCreate = () => { name="filename" /> - + + Тип + + {errors.media_type && ( + + {!!(errors as any)?.message} + + )} + )