import React from "react"; import { Flex, Link, HStack, Skeleton, Box, Heading } from "@chakra-ui/react"; import { ExternalLinkIcon } from "@chakra-ui/icons"; import { useJournalEntry, useRouter } from "../../src/core/hooks"; import FourOFour from "../../src/components/FourOFour"; import FourOThree from "../../src/components/FourOThree"; import Tags from "../../src/components/Tags"; import CustomIcon from "../../src/components/CustomIcon"; import { getLayout } from "../../src/layouts/EntriesLayout"; import MarkdownView from "react-showdown"; import Scrollable from "../../src/components/Scrollable"; const Entry = () => { const showdownHighlight = require("showdown-highlight"); const router = useRouter(); const { entryId } = router.params; const journalId = `9b0d7567-4634-4bf7-946d-60ef4414aa93`; const { data: entry, isFetchedAfterMount, isLoading, isError, error, } = useJournalEntry(journalId, entryId, "personal"); const contextUrl = () => { if (entry?.context_url) { switch (entry.context_type) { case "slack": return ( ); case "github": return ( ); default: return ( ); } } else return ""; }; if (isError && error.response.status === 404) return ; if (isError && error.response.status === 403) return ; // if (!entry || isLoading) return ""; return ( {contextUrl()} {entry?.title} ); }; Entry.getLayout = getLayout; export default Entry;