diff --git a/apps/web/package.json b/apps/web/package.json index 77494fc3..5d716e0f 100644 --- a/apps/web/package.json +++ b/apps/web/package.json @@ -15,6 +15,7 @@ "@radix-ui/react-checkbox": "^1.1.2", "@radix-ui/react-label": "^2.1.0", "@radix-ui/react-radio-group": "^1.2.1", + "@radix-ui/react-select": "^2.2.6", "@radix-ui/react-slot": "^1.1.0", "@tanstack/react-query": "^5.90.2", "@trpc/client": "^11.6.0", @@ -27,6 +28,7 @@ "dompurify": "^3.3.0", "framer-motion": "^11.15.0", "geist": "^1.5.1", + "gray-matter": "^4.0.3", "lucide-react": "^0.456.0", "next": "15.5.3", "next-auth": "^4.24.11", @@ -34,8 +36,10 @@ "posthog-js": "^1.203.1", "react": "^18.2.0", "react-dom": "^18.2.0", + "react-markdown": "^10.1.0", "react-qr-code": "^2.0.18", "react-tweet": "^3.2.1", + "remark-gfm": "^4.0.1", "superjson": "^2.2.5", "tailwind-merge": "^2.5.4", "tailwindcss-animate": "^1.0.7", diff --git a/apps/web/src/app/(main)/dashboard/newsletter/[slug]/page.tsx b/apps/web/src/app/(main)/dashboard/newsletter/[slug]/page.tsx new file mode 100644 index 00000000..bb4bfa97 --- /dev/null +++ b/apps/web/src/app/(main)/dashboard/newsletter/[slug]/page.tsx @@ -0,0 +1,15 @@ +import { NewsletterView } from "@/components/dashboard/NewsletterView"; +import { getNewsletter } from "@/utils/getMarkdownNewsletter"; + +export default async function NewsletterViewPage({ + params, +}: { + params: Promise<{ slug: string }>; +}) { + const { slug } = await params; + const newsletter = getNewsletter(slug); + + if (!newsletter) return
Not Found
; + + return ; +} diff --git a/apps/web/src/app/(main)/dashboard/newsletter/page.tsx b/apps/web/src/app/(main)/dashboard/newsletter/page.tsx new file mode 100644 index 00000000..f4664cc2 --- /dev/null +++ b/apps/web/src/app/(main)/dashboard/newsletter/page.tsx @@ -0,0 +1,15 @@ +import NewsLetterContainer from "@/components/dashboard/NewsLetterContainer"; +import { getAllNewsletters } from "@/utils/getMarkdownNewsletter"; + +import React from "react"; + +async function NewsletterPage() { + const newsletters = await getAllNewsletters(); + return ( +
+ +
+ ); +} + +export default NewsletterPage; diff --git a/apps/web/src/components/dashboard/MarkdownViewer.tsx b/apps/web/src/components/dashboard/MarkdownViewer.tsx new file mode 100644 index 00000000..987a7368 --- /dev/null +++ b/apps/web/src/components/dashboard/MarkdownViewer.tsx @@ -0,0 +1,114 @@ +"use client"; + +import React from "react"; +import ReactMarkdown from "react-markdown"; +import remarkGfm from "remark-gfm"; + +interface MarkdownViewerProps { + content: string; +} + +export function MarkdownViewer({ content }: MarkdownViewerProps) { + return ( +
+ ( +

+ ), + h2: ({ node, ...props }) => ( +

+ ), + h3: ({ node, ...props }) => ( +

+ ), + p: ({ node, ...props }) => ( +

+ ), + ul: ({ node, ...props }) => ( +