# Landing Page (Public Page Renderer) ## Overview **File Path:** `admin/src/pages/public/LandingPage.tsx` (68 lines) **Route:** `/p/:slug` **Role Requirements:** Public access **Purpose:** Simple renderer for admin-authored landing pages created with GrapesJS editor. Fetches page by slug and displays HTML/CSS content with SEO meta tags. **Key Features:** - Minimal wrapper around admin-authored HTML - SEO meta tags (title, description, og:image) - dangerouslySetInnerHTML for HTML + CSS rendering - Loading spinner during fetch - 404 page for invalid slugs - No layout wrapper (pages are self-contained) --- ## Features ### 1. SEO Meta Tags ```tsx {page.title} {page.coverImage && } ``` ### 2. HTML Rendering ```tsx
``` ### 3. Loading State ```tsx {loading && (
)} ``` ### 4. 404 Handling ```tsx {!loading && !page && ( } /> )} ``` --- ## API Integration ```http GET /api/public/pages/:slug ``` Response: ```json { "slug": "welcome", "title": "Welcome to Our Campaign", "description": "Join us in making a difference", "html": "

Welcome

...
", "css": "h1 { color: #1890ff; }", "coverImage": "https://example.com/cover.jpg", "isPublished": true } ``` --- ## Security Considerations **XSS Risk Accepted:** - Pages authored by trusted admins only - dangerouslySetInnerHTML allows full HTML/JS - No user-submitted content - Alternative would break GrapesJS output --- ## Related Documentation - [Landing Pages Admin](../admin/landing-pages-page.md) - [Page Editor](../admin/page-editor-page.md) - [GrapesJS Component](../../components/grapesjs-editor.md)