diff --git a/components/pages/workPageLayout/WorkPageButtons.tsx b/components/pages/workPageLayout/WorkPageButtons.tsx index 3255b00..4db2866 100644 --- a/components/pages/workPageLayout/WorkPageButtons.tsx +++ b/components/pages/workPageLayout/WorkPageButtons.tsx @@ -7,7 +7,7 @@ import SmartLink from "@/components/shared/smartLink/SmartLink" import { resolveUrl } from "@/lib/helpers/helper.routes" import { useSelectedManifestationStore } from "@/store/selectedManifestation.store" -import { isAudioBook, isEbook } from "./helper" +import { isAudioBook, isEbook, isPodcast } from "./helper" export type WorkPageButtonsProps = { workId: string @@ -41,7 +41,6 @@ const WorkPageButtons = ({ workId }: WorkPageButtonsProps) => { )} - {isAudioBook(selectedManifestation) && ( <> )} + {isPodcast(selectedManifestation) && ( + <> + + + + )} {/* Reader / Player dialog */} {!!selectedManifestation?.identifiers[0].value && ( @@ -64,8 +77,12 @@ const WorkPageButtons = ({ workId }: WorkPageButtonsProps) => { onOpenChange={() => { setIsPlayerOpen(!isPlayerOpen) }} - title="Prøv lydbog" - description="For at låne lydbogen skal du være oprettet som bruger på GO."> + title={`Prøv ${isPodcast(selectedManifestation) ? "Podcast" : "Lydbog"}`} + description={ + isPodcast(selectedManifestation) + ? "For at høre podcast skal du være oprettet som bruger på GO." + : "For at låne lydbogen skal du være oprettet som bruger på GO." + }> )} diff --git a/components/pages/workPageLayout/helper.ts b/components/pages/workPageLayout/helper.ts index 701d3e2..6726aa7 100644 --- a/components/pages/workPageLayout/helper.ts +++ b/components/pages/workPageLayout/helper.ts @@ -72,6 +72,11 @@ export const isAudioBook = (manifestation: ManifestationWorkPageFragment | undef return isOfMaterialType(manifestation, GeneralMaterialTypeCodeEnum.AudioBooks) } +export const isPodcast = (manifestation: ManifestationWorkPageFragment | undefined | null) => { + if (!manifestation) return false + return isOfMaterialType(manifestation, GeneralMaterialTypeCodeEnum.Podcasts) +} + export const getIsbnsFromManifestation = ( manifestaion: ManifestationWorkPageFragment | undefined | null ) => {