Files
supabase/apps/www/components/Blog/BlogCollapsible.tsx
Charis a1611bf449 www: render blog posts on server (#45461)
Render blog posts on server so they are available in initial HTML
response.

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **New Features**
  * New collapsible sections for blog content
  * Server-side MDX compilation for blog posts
  * Improved TOC extraction producing both structured JSON and markdown

* **Refactor**
* Blog rendering converted to a server-rendered flow with unified MDX
components
  * Tag handling normalized for related-post matching

* **Bug Fixes**
* Consistent image/self-closing tag normalization and corrected TOC
indentation
  * Errors are now surfaced instead of being swallowed
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
2026-05-04 10:39:42 -04:00

36 lines
1018 B
TypeScript

'use client'
import { Triangle } from 'lucide-react'
import type { PropsWithChildren } from 'react'
import { Collapsible_Shadcn_, CollapsibleContent_Shadcn_, CollapsibleTrigger_Shadcn_ } from 'ui'
type BlogCollapsibleProps = PropsWithChildren<{
title: string
containerClassName?: string
}>
const BlogCollapsible = ({ title, containerClassName, ...props }: BlogCollapsibleProps) => {
return (
<Collapsible_Shadcn_ className={containerClassName}>
<CollapsibleTrigger_Shadcn_
className="
data-[state=open]:text
hover:text-foreground-light
flex items-center gap-3
[&>svg]:fill-current
[&>svg]:rotate-90
[&>svg]:transition-transform
[&>svg]:data-[state='open']:rotate-180
[&>svg]:data-[state='open']:text
"
>
<Triangle size={10} />
<span>{title}</span>
</CollapsibleTrigger_Shadcn_>
<CollapsibleContent_Shadcn_ {...props} />
</Collapsible_Shadcn_>
)
}
export default BlogCollapsible