Skip to content

Commit

Permalink
Add a button to remove surveyors from individual assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrewy-gh committed Oct 29, 2024
1 parent 755cdaf commit f8fe475
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions frontend/front/src/pages/Admin/assignment/AssignTable.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, Button, MenuItem, Stack } from "@mui/material";
import { Box, Button, Chip, MenuItem, Stack } from "@mui/material";
import React, { useMemo, useState } from "react";
import {
useAddAssignmentsToSurveyorMutation,
Expand Down Expand Up @@ -135,21 +135,24 @@ const AssignTable = () => {
maxWidth="100%"
justifyContent="flex-start"
overflow="scroll"
sx={{ overflowY: "auto", overflowX: "auto" }}
sx={{ overflowY: "auto", overflowX: "auto", pl: 2 }}
flexWrap="wrap"
>
{params.row.surveyorData.map((surveyor) => {
return (
<Button
<Chip
key={`surveyor-${surveyor.id}`}
label={`${surveyor.firstname} ${surveyor.lastname}`}
color="primary"
variant="outlined"
onClick={() => handleUserLink(surveyor)}
sx={{
textAlign: "left",
minWidth: "max-content",
}}
>
{`${surveyor.firstname} ${surveyor.lastname}`}
</Button>
onDelete={() =>
removeAssignmentsFromSurveyor({
surveyorId: surveyor.id,
assignmentIds: [params.row.id],
})
}
/>
);
})}
</Stack>
Expand Down

0 comments on commit f8fe475

Please sign in to comment.