Final work to add torrents categories

This commit is contained in:
LIAUD Corentin
2024-03-24 16:10:49 +01:00
parent 28e24de557
commit a7417a221a
11 changed files with 73 additions and 60 deletions

View File

@@ -69,6 +69,8 @@ export default function RightSideComponent({
setIsUserInteractedWithPoster(true)
}
const torrentCategories = ['Movies', 'Series', 'Music', 'Other', 'Unknown']
return (
<RightSide>
<RightSideContainer isHidden={!isTorrentSourceCorrect || (isHashAlreadyExists && !isEditMode)}>
@@ -113,26 +115,6 @@ export default function RightSideComponent({
),
}}
/>
<FormControl fullWidth>
<InputLabel id='torrent-category-select-label'>Torrent category</InputLabel>
<Select
labelId='torrent-category-select-label'
id='torrent-category-select'
value={category}
label='Torrent category'
margin='dense'
onChange={handleCategoryChange}
variant='outlined'
fullWidth
>
<MenuItem value='Films'>Films</MenuItem>
<MenuItem value='Series'>Series</MenuItem>
<MenuItem value='Music'>Music</MenuItem>
<MenuItem value='Other'>Other</MenuItem>
<MenuItem value='Unknown'>Unknown</MenuItem>
</Select>
</FormControl>
</>
) : (
<TextField
@@ -156,6 +138,25 @@ export default function RightSideComponent({
fullWidth
/>
<FormControl fullWidth>
<InputLabel id='torrent-category-select-label'>Torrent category</InputLabel>
<Select
labelId='torrent-category-select-label'
id='torrent-category-select'
value={category}
label='Torrent category'
margin='dense'
onChange={handleCategoryChange}
variant='outlined'
fullWidth
defaultValue='Unknown'
>
{torrentCategories.map(category => (
<MenuItem value={category}>{category}</MenuItem>
))}
</Select>
</FormControl>
<PosterWrapper>
<Poster poster={+isPosterUrlCorrect}>
{isPosterUrlCorrect ? <img src={posterUrl} alt='poster' /> : <NoImageIcon />}