refactor: generaliser stems en kits (type Stems/Acapella+Instru)
This commit is contained in:
@@ -21,7 +21,7 @@ const PLATFORM_ICON = {
|
||||
kDrive: CloudDownloadIcon,
|
||||
}
|
||||
|
||||
export default function StemsDialog({stems}) {
|
||||
export default function KitsDialog({kits}) {
|
||||
const [open, setOpen] = useState(false)
|
||||
const theme = useTheme()
|
||||
const fullScreen = useMediaQuery(theme.breakpoints.down('md'))
|
||||
@@ -37,26 +37,26 @@ export default function StemsDialog({stems}) {
|
||||
return (
|
||||
<>
|
||||
<Button endIcon={<CloudDownloadIcon />} sx={{marginBottom: 2}} variant='outlined' onClick={handleClickOpen}>
|
||||
Stems
|
||||
Kits
|
||||
</Button>
|
||||
<Dialog
|
||||
fullScreen={fullScreen}
|
||||
open={open}
|
||||
aria-labelledby='StemsDialog'
|
||||
aria-labelledby='KitsDialog'
|
||||
onClose={handleClose}
|
||||
>
|
||||
<DialogTitle>Télécharger les stems</DialogTitle>
|
||||
<DialogTitle>Télécharger un kit</DialogTitle>
|
||||
<DialogContent dividers>
|
||||
<List>
|
||||
{stems.map((stem, index) => {
|
||||
const PlatformIcon = PLATFORM_ICON[stem.plateforme] ?? CloudDownloadIcon
|
||||
{kits.map((kit, index) => {
|
||||
const PlatformIcon = PLATFORM_ICON[kit.plateforme] ?? CloudDownloadIcon
|
||||
return (
|
||||
<ListItem key={index} disablePadding>
|
||||
<ListItemButton component='a' href={stem.url} target='_blank' rel='noopener noreferrer'>
|
||||
<ListItemButton component='a' href={kit.url} target='_blank' rel='noopener noreferrer'>
|
||||
<ListItemIcon>
|
||||
<PlatformIcon />
|
||||
</ListItemIcon>
|
||||
<ListItemText primary={stem.plateforme} />
|
||||
<ListItemText primary={kit.type} secondary={kit.plateforme} />
|
||||
</ListItemButton>
|
||||
</ListItem>
|
||||
)
|
||||
@@ -73,6 +73,6 @@ export default function StemsDialog({stems}) {
|
||||
)
|
||||
}
|
||||
|
||||
StemsDialog.propTypes = {
|
||||
stems: PropTypes.array.isRequired
|
||||
KitsDialog.propTypes = {
|
||||
kits: PropTypes.array.isRequired
|
||||
}
|
||||
Reference in New Issue
Block a user