Skip to content

Commit

Permalink
Show meal type in note form
Browse files Browse the repository at this point in the history
  • Loading branch information
pkirilin committed Oct 27, 2024
1 parent d31ce82 commit a9e7dd8
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions src/frontend/src/features/addNote/ui/NoteForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { IconButton, InputAdornment, TextField, Tooltip } from '@mui/material';
import { useEffect, type FC } from 'react';
import { Controller, useForm } from 'react-hook-form';
import { useAppDispatch, useAppSelector } from '@/app/store';
import { noteApi } from '@/entities/note';
import { noteApi, noteLib, noteModel } from '@/entities/note';
import { actions, selectors, noteSchema, type NoteFormValues } from '../model';

interface Props {
Expand Down Expand Up @@ -44,7 +44,18 @@ export const NoteForm: FC<Props> = ({ defaultValues }) => {
});
})}
>
{/* TODO: show meal type */}
<TextField
label="Meal type"
value={noteLib.getMealName(noteDraft?.mealType ?? noteModel.MealType.Breakfast)}
fullWidth
margin="normal"
helperText=" "
slotProps={{
input: {
readOnly: true,
},
}}
/>
<TextField
label="Product"
value={noteDraft?.product?.name}
Expand Down

0 comments on commit a9e7dd8

Please sign in to comment.