1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00

Migrate scheduled tasks to React (#6506)

* Migrate scheduled tasks to React

* Adjust margins

* Use localeCompare

* Clean up imports

* Use legacy apiclient from useApi

* Fix import

* Fix nested typography

* Add polling fallback

* Cleanup code

* Rename to tasks

* Rename to Component

* Use constants for websocket events

* Use memo to fix timestamp rerender on run
This commit is contained in:
viown 2025-02-21 00:18:42 +03:00 committed by GitHub
parent 201a3c32f8
commit f573221643
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 362 additions and 224 deletions

View file

@ -0,0 +1,29 @@
import React, { FunctionComponent } from 'react';
import type { TaskInfo } from '@jellyfin/sdk/lib/generated-client/models/task-info';
import List from '@mui/material/List';
import Typography from '@mui/material/Typography';
import Stack from '@mui/material/Stack';
import Task from './Task';
type TasksProps = {
category: string;
tasks: TaskInfo[];
};
const Tasks: FunctionComponent<TasksProps> = ({ category, tasks }: TasksProps) => {
return (
<Stack spacing={2}>
<Typography variant='h2'>{category}</Typography>
<List sx={{ bgcolor: 'background.paper' }}>
{tasks.map(task => {
return <Task
key={task.Id}
task={task}
/>;
})}
</List>
</Stack>
);
};
export default Tasks;