* chore: paginated the issues in space app * chore: storing query using filters * chore: added filters for priority * chore: issue view model save function * chore: votes and reactions added in issues endpoint * chore: added filters in the public endpoint * chore: issue detail endpoint * chore: added labels, modules and assignees * refactor existing project publish in space app * fix clear all filters in space App * chore: removed the extra serialier * remove optional chaining and fallback to an empty array --------- Co-authored-by: NarayanBavisetti <narayan3119@gmail.com>
37 lines
1 KiB
TypeScript
37 lines
1 KiB
TypeScript
"use client";
|
|
|
|
import { observer } from "mobx-react";
|
|
import { useSearchParams } from "next/navigation";
|
|
import useSWR from "swr";
|
|
// components
|
|
import { IssuesLayoutsRoot } from "@/components/issues";
|
|
// hooks
|
|
import { usePublish, useLabel, useStates } from "@/hooks/store";
|
|
|
|
type Props = {
|
|
params: {
|
|
anchor: string;
|
|
};
|
|
};
|
|
|
|
const IssuesPage = observer((props: Props) => {
|
|
const { params } = props;
|
|
const { anchor } = params;
|
|
// params
|
|
const searchParams = useSearchParams();
|
|
const peekId = searchParams.get("peekId") || undefined;
|
|
// store
|
|
const { fetchStates } = useStates();
|
|
const { fetchLabels } = useLabel();
|
|
|
|
useSWR(anchor ? `PUBLIC_STATES_${anchor}` : null, anchor ? () => fetchStates(anchor) : null);
|
|
useSWR(anchor ? `PUBLIC_LABELS_${anchor}` : null, anchor ? () => fetchLabels(anchor) : null);
|
|
|
|
const publishSettings = usePublish(anchor);
|
|
|
|
if (!publishSettings) return null;
|
|
|
|
return <IssuesLayoutsRoot peekId={peekId} publishSettings={publishSettings} />;
|
|
});
|
|
|
|
export default IssuesPage;
|