Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const SegmentInput: FC = props => {
const translate = useTranslate();
const classes = useStyles();
return (
({
id: segment.id,
name: translate(segment.name),
}))}
className={classes.input}
/>
);
};
const CustomUserMenu = ({ onClick, ...rest }) => {
const translate = useTranslate()
const resources = useSelector(getResources)
const classes = useStyles(rest)
const { permissions } = usePermissions()
const resourceDefinition = (resourceName) =>
resources.find((r) => r?.name === resourceName)
const renderUserMenuItemLink = () => {
const userResource = resourceDefinition('user')
if (!userResource) {
return null
}
if (permissions !== 'admin') {
if (!config.enableUserEditing) {
return null
}
const QuickFilter = ({ label }) => {
const translate = useTranslate();
const classes = useQuickFilterStyles();
return ;
};
const PersonalMenu = forwardRef(({ onClick, sidebarIsOpen, dense }, ref) => {
const translate = useTranslate()
const classes = useStyles()
return (
}
onClick={onClick}
className={classes.menuItem}
sidebarIsOpen={sidebarIsOpen}
dense={dense}
/>
)
})
const AlbumActions = ({
className,
ids,
data,
record,
permanentFilter,
...rest
}) => {
const dispatch = useDispatch()
const translate = useTranslate()
const classes = useStyles()
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('md'))
const isNotSmall = useMediaQuery((theme) => theme.breakpoints.up('sm'))
const handlePlay = React.useCallback(() => {
dispatch(playTracks(data, ids))
}, [dispatch, data, ids])
const handlePlayNext = React.useCallback(() => {
dispatch(playNext(data, ids))
}, [dispatch, data, ids])
const handlePlayLater = React.useCallback(() => {
dispatch(addTracks(data, ids))
}, [dispatch, data, ids])
const UserTitle = ({ record }) => {
const translate = useTranslate()
const resourceName = translate('resources.user.name', { smart_count: 1 })
return <title>
}
</title>
const SubMenu: FC = ({
handleToggle,
sidebarIsOpen,
isOpen,
name,
icon,
children,
dense,
}) => {
const translate = useTranslate();
const classes = useStyles();
const header = (
<menuitem>
{isOpen ? : icon}
{translate(name)}
</menuitem>
);
return (
{sidebarIsOpen || isOpen ? (
const Configuration = () => {
const translate = useTranslate();
const locale = useLocale();
const setLocale = useSetLocale();
const classes = useStyles();
const theme = useSelector((state: AppState) => state.theme);
const dispatch = useDispatch();
return (
<title title="{translate('pos.configuration')}">
<CardContent>
<div className={classes.label}>
{translate('pos.theme.name')}
</div>
<Button
variant="contained"
className={classes.button}
color={theme === 'light' ? 'primary' : 'default'}</title>
({ showTitle = true, disableElevation, fullWidth }, ref) => {
const dispatch = useDispatch()
const albumView = useSelector((state) => state.albumView)
const classes = useStyles()
const translate = useTranslate()
return (
<div>
{showTitle && (
{translate('ra.toggleFieldsMenu.layout')}
)}
</div>
const PlaylistActions = ({ className, ids, data, record, ...rest }) => {
const dispatch = useDispatch()
const translate = useTranslate()
const classes = useStyles()
const dataProvider = useDataProvider()
const notify = useNotify()
const isDesktop = useMediaQuery((theme) => theme.breakpoints.up('md'))
const isNotSmall = useMediaQuery((theme) => theme.breakpoints.up('sm'))
const getAllSongsAndDispatch = React.useCallback(
(action) => {
if (ids.length === record.songCount) {
return dispatch(action(data, ids))
}
dataProvider
.getList('playlistTrack', {
pagination: { page: 1, perPage: 0 },
sort: { field: 'id', order: 'ASC' },