-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor(taxonomy-editor-frontend):create a component for nodes table…
… used in nodes and search pages
- Loading branch information
alice.juan
committed
Nov 16, 2023
1 parent
2b0c528
commit e94b440
Showing
4 changed files
with
60 additions
and
44 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
42 changes: 42 additions & 0 deletions
42
taxonomy-editor-frontend/src/components/NodesTableBody.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { | ||
IconButton, | ||
TableBody, | ||
TableCell, | ||
TableRow, | ||
Typography, | ||
} from "@mui/material"; | ||
import EditIcon from "@mui/icons-material/Edit"; | ||
import { Link } from "react-router-dom"; | ||
|
||
type Props = { | ||
nodeIds: string[]; | ||
taxonomyName: string; | ||
branchName: string; | ||
}; | ||
|
||
const NodesTableBody = ({ nodeIds, taxonomyName, branchName }: Props) => { | ||
return ( | ||
<> | ||
<TableBody> | ||
{nodeIds.map((nodeId) => ( | ||
<TableRow key={nodeId}> | ||
<TableCell align="left" component="td" scope="row"> | ||
<Typography variant="subtitle1">{nodeId}</Typography> | ||
</TableCell> | ||
<TableCell align="left" component="td" scope="row"> | ||
<IconButton | ||
component={Link} | ||
to={`/${taxonomyName}/${branchName}/entry/${nodeId}`} | ||
aria-label="edit" | ||
> | ||
<EditIcon color="primary" /> | ||
</IconButton> | ||
</TableCell> | ||
</TableRow> | ||
))} | ||
</TableBody> | ||
</> | ||
); | ||
}; | ||
|
||
export default NodesTableBody; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters