[PE-182] refactor: pages' components and store for scalability (#6283)

* refactor: created a generic base page instance

* refactor: project store hooks

* chore: add missing prop declaration

* refactor: editor page root and body

* refactor: issue embed hook

* chore: update search entity types

* fix: version editor component

* fix: add page to favorites action

---------

Co-authored-by: Prateek Shourya <prateekshourya29@gmail.com>
This commit is contained in:
Aaryan Khandelwal 2024-12-27 20:41:38 +05:30 committed by GitHub
parent 211d5e1cd0
commit 8d7425a3b7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
34 changed files with 553 additions and 521 deletions

View file

@ -1,12 +1,18 @@
// editor
import { TEmbedConfig } from "@plane/editor";
// types
import { TPageEmbedType } from "@plane/types";
// plane types
import { TSearchEntityRequestPayload, TSearchResponse } from "@plane/types";
// plane web components
import { IssueEmbedUpgradeCard } from "@/plane-web/components/pages";
export type TIssueEmbedHookProps = {
fetchEmbedSuggestions?: (payload: TSearchEntityRequestPayload) => Promise<TSearchResponse>;
projectId?: string;
workspaceSlug?: string;
};
// eslint-disable-next-line @typescript-eslint/no-unused-vars
export const useIssueEmbed = (workspaceSlug: string, projectId: string, queryType: TPageEmbedType = "issue") => {
export const useIssueEmbed = (props: TIssueEmbedHookProps) => {
const widgetCallback = () => <IssueEmbedUpgradeCard />;
const issueEmbedProps: TEmbedConfig["issue"] = {