diff --git a/components/Current/Asides/Puff/index.tsx b/components/Current/Asides/Puff/index.tsx index eab5eeff4..ac2054e42 100644 --- a/components/Current/Asides/Puff/index.tsx +++ b/components/Current/Asides/Puff/index.tsx @@ -8,16 +8,23 @@ import styles from "./puff.module.css" import type { PuffProps } from "@/types/components/current/asides/puff" -export default function Puff({ imageConnection, is_internal, link, link_text, pageConnection, system, text, title }: PuffProps) { - return is_internal ? ( - - - - ) : ( +export default function Puff({ imageConnection, is_internal, link, link_text, pageConnection, text, title }: PuffProps) { + if (is_internal) { + const page = pageConnection.edges[0] + if (!page?.node?.url) { + return null + } + return ( + + + + ) + } + return ( + pageConnection: Edges } }, BlockListItemsEnum.CurrentBlocksPageBlocksListBlockListItemsListItemInternalLink diff --git a/types/requests/currentBlockPage.ts b/types/requests/currentBlockPage.ts index 1461baf4e..251d29753 100644 --- a/types/requests/currentBlockPage.ts +++ b/types/requests/currentBlockPage.ts @@ -33,11 +33,7 @@ export interface CurrentBlocksPageBreadcrumb extends SharedBreadcrumb { __typename: EmbedEnum.CurrentBlocksPage } -export interface TempPageBreadcrumb extends SharedBreadcrumb { - __typename: EmbedEnum.TempPage -} - -export type Breadcrumb = CurrentBlocksPageBreadcrumb | TempPageBreadcrumb +export type Breadcrumb = CurrentBlocksPageBreadcrumb export type Breadcrumbs = { parentsConnection: Edges diff --git a/types/requests/embeds.ts b/types/requests/embeds.ts index 140dab873..77d4dc5d3 100644 --- a/types/requests/embeds.ts +++ b/types/requests/embeds.ts @@ -1,5 +1,4 @@ import type { SysAsset } from "./utils/asset" -import type { TempPageLinkType } from "./utils/tempPageLink" import type { PageLinkType } from "./utils/pageLink" -export type Embeds = TempPageLinkType | PageLinkType | SysAsset +export type Embeds = PageLinkType | SysAsset diff --git a/types/requests/puff.ts b/types/requests/puff.ts index 85cc77c6a..b1d6fc553 100644 --- a/types/requests/puff.ts +++ b/types/requests/puff.ts @@ -1,7 +1,6 @@ import type { Image } from "../image" import type { Edges } from "./utils/edges" import type { Embeds } from "./embeds" -import type { TempPageLink } from "./utils/tempPageLink" import type { PageLink } from "./utils/pageLink" import type { RTEDocument } from "../rte/node" @@ -13,7 +12,7 @@ export type Puff = { title: string } link_text?: string - pageConnection: Edges + pageConnection: Edges system: { uid: string } diff --git a/types/requests/utils/embeds.ts b/types/requests/utils/embeds.ts index c6233eecf..8cdb3fcaa 100644 --- a/types/requests/utils/embeds.ts +++ b/types/requests/utils/embeds.ts @@ -1,7 +1,6 @@ export enum EmbedEnum { CurrentBlocksPage = "CurrentBlocksPage", SysAsset = "SysAsset", - TempPage = "TempPage", } export type Embed = keyof typeof EmbedEnum diff --git a/types/requests/utils/tempPageLink.ts b/types/requests/utils/tempPageLink.ts deleted file mode 100644 index 0230fa8be..000000000 --- a/types/requests/utils/tempPageLink.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { Lang } from "@/types/lang" -import type { EmbedEnum } from "./embeds" -import type { Typename } from "./typename" - -export type TempPageLink = { - system: { - uid: string - locale: Lang - } - title: string - url: string -} - -export type TempPageLinkType = Typename