- {loadingTasks ? (
-
- Loading...
-
- ) : (
- <>
- {tasks && tasks.length > 0 ? (
- (rowsPerPage > 0
- ? tasks.slice(
- page * rowsPerPage,
- page * rowsPerPage + rowsPerPage
- )
- : /* istanbul ignore next */
- tasks
- ).map((task: any, index) => {
- const volunteers: any = task.volunteers.map(
- (volunteer: any) => {
- return {
- id: volunteer._id,
- firstName: volunteer.firstName,
- lastName: volunteer.lastName,
- email: volunteer.email,
- };
- }
- );
-
- const cardProps: InterfaceTaskCardProps = {
- title: task.title,
- id: task._id,
- description: task.description,
- deadline: task.deadline,
- volunteers,
- createdAt: task.createdAt,
- completed: task.completed,
- creator: {
- id: task.creator._id,
- firstName: task.creator.firstName,
- lastName: task.creator.lastName,
- },
- event: {
- id: task.event._id,
- title: task.event.title,
- organization: {
- id: task.event.organization._id,
- name: task.event.organization.name,
- image: task.event.organization.image,
- },
- },
- };
-
- return
;
- })
- ) : (
-
{t('nothingToShow')}
- )}
- >
- )}
-