Add category associated to each torrent

This commit is contained in:
LIAUD Corentin
2023-11-22 14:08:10 +01:00
parent 286609acec
commit 8c92856595
22 changed files with 171 additions and 70 deletions

View File

@@ -1,7 +1,16 @@
import { useTranslation } from 'react-i18next'
import { rgba } from 'polished'
import { NoImageIcon } from 'icons'
import { IconButton, InputAdornment, TextField, useTheme } from '@material-ui/core'
import {
FormControl,
IconButton,
InputAdornment,
InputLabel,
MenuItem,
Select,
TextField,
useTheme,
} from '@material-ui/core'
import { HighlightOff as HighlightOffIcon } from '@material-ui/icons'
import {
@@ -18,6 +27,7 @@ import { checkImageURL } from './helpers'
export default function RightSideComponent({
setTitle,
setCategory,
setPosterUrl,
setIsPosterUrlCorrect,
setIsUserInteractedWithPoster,
@@ -25,6 +35,7 @@ export default function RightSideComponent({
isTorrentSourceCorrect,
isHashAlreadyExists,
title,
category,
parsedTitle,
posterUrl,
isPosterUrlCorrect,
@@ -45,6 +56,7 @@ export default function RightSideComponent({
const primary = useTheme().palette.primary.main
const handleTitleChange = ({ target: { value } }) => setTitle(value)
const handleCategoryChange = ({ target: { value } }) => setCategory(value)
const handlePosterUrlChange = ({ target: { value } }) => {
setPosterUrl(value)
checkImageURL(value).then(setIsPosterUrlCorrect)
@@ -101,6 +113,26 @@ 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