fix alerter and repo routing, alerter card link

This commit is contained in:
karamvir
2023-08-03 17:01:17 -07:00
parent 5d5578f89f
commit c1a6f2b957
2 changed files with 12 additions and 10 deletions

View File

@@ -3,7 +3,7 @@ import { useAddRecentlyViewed, useRead } from "@hooks";
import { ResourceCard } from "@layouts/card";
import { Resource } from "@layouts/resource";
import { AlarmClock } from "lucide-react";
import { useParams } from "react-router-dom";
import { Link, useParams } from "react-router-dom";
export const AlerterName = ({ id }: { id: string }) => {
const alerters = useRead("ListAlerters", {}).data;
@@ -40,12 +40,14 @@ export const AlerterCard = ({ id }: { id: string }) => {
const alerter = alerters?.find((a) => a._id?.$oid === id);
if (!alerter) return null;
return (
<ResourceCard
title={alerter.name}
description={alerter.description ?? "some desc"}
statusIcon={<AlarmClock className="w-4 h-4" />}
>
<div></div>
</ResourceCard>
<Link to={`/alerters/${id}`}>
<ResourceCard
title={alerter.name}
description={alerter.description ?? "some desc"}
statusIcon={<AlarmClock className="w-4 h-4" />}
>
<div></div>
</ResourceCard>
</Link>
);
};

View File

@@ -59,14 +59,14 @@ const router = createBrowserRouter([
path: "alerters",
children: [
{ path: "", element: <Alerters /> },
{ path: ":builderId", element: <AlerterPage /> },
{ path: ":alerterId", element: <AlerterPage /> },
],
},
{
path: "repos",
children: [
{ path: "", element: <Repos /> },
{ path: ":builderId", element: <RepoPage /> },
{ path: ":repoId", element: <RepoPage /> },
],
},
],