plane/space/app/issues/[anchor]/page.tsx

34 lines
889 B
TypeScript
Raw Normal View History

2024-06-04 08:08:47 +00:00
"use client";
import { useSearchParams } from "next/navigation";
import useSWR from "swr";
// components
import { ProjectDetailsView } from "@/components/views";
// hooks
import { usePublish, usePublishList } from "@/hooks/store";
type Props = {
params: {
anchor: string;
};
};
const ProjectIssuesPage = (props: Props) => {
const { params } = props;
const { anchor } = params;
// params
const searchParams = useSearchParams();
const peekId = searchParams.get("peekId") || undefined;
// store hooks
const { fetchPublishSettings } = usePublishList();
const publishSettings = usePublish(anchor);
useSWR(anchor ? `PUBLISH_SETTINGS_${anchor}` : null, anchor ? () => fetchPublishSettings(anchor) : null);
if (!publishSettings) return null;
return <ProjectDetailsView peekId={peekId} publishSettings={publishSettings} />;
};
export default ProjectIssuesPage;