Skip to content

Commit 3d2de1f

Browse files
committed
fix(results-page): imrpove project link on instances
1 parent 300c21b commit 3d2de1f

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

components/projects/ProjectListItem.tsx

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import type { ProjectDetail } from "@squonk/data-manager-client";
22

33
import { AccountTreeRounded as AccountTreeRoundedIcon } from "@mui/icons-material";
44
import { ListItemButton, ListItemIcon, ListItemText, Tooltip } from "@mui/material";
5+
import NextLink from "next/link";
56
import { useRouter } from "next/router";
67

78
import { useCurrentProjectId } from "../../hooks/projectHooks";
@@ -33,9 +34,20 @@ export const ProjectListItem = ({ project, clickAction }: ProjectListItemProps)
3334
push("/project");
3435
}
3536
};
37+
38+
const props = {
39+
"navigate-to-project": {
40+
href: "/project",
41+
LinkComponent: NextLink,
42+
},
43+
"select-project": {
44+
onClick,
45+
},
46+
};
47+
3648
return (
3749
<Tooltip title={TOOLTIPS[action]}>
38-
<ListItemButton component="li" sx={{ flexGrow: 0 }} onClick={onClick}>
50+
<ListItemButton sx={{ flexGrow: 0 }} {...props[action]}>
3951
<ListItemIcon sx={{ minWidth: "40px" }}>
4052
<AccountTreeRoundedIcon />
4153
</ListItemIcon>

0 commit comments

Comments
 (0)