supermemory/apps/web/components/new/document-modal/content/web-page.tsx
MaheshtheDev 1423bd7004 feat: mobile responsive, lint formats, toast, render issue fix (#688)
- Mobile responsive
- new toast design
- web document render issue fix
- posthog analytics
- ui improvements
2026-01-21 03:11:53 +00:00

27 lines
666 B
TypeScript

import React from "react"
import { Streamdown } from "streamdown"
const components = {
p: ({ children, ...props }: React.ComponentPropsWithoutRef<"p">) => {
const hasDiv = React.Children.toArray(children).some(
(child) =>
React.isValidElement(child) &&
typeof child.type === "string" &&
child.type === "div",
)
if (hasDiv) {
return <div {...props}>{children}</div>
}
return <p {...props}>{children}</p>
},
} as const
export function WebPageContent({ content }: { content: string }) {
return (
<div className="p-4 overflow-y-auto flex-1 scrollbar-thin">
<Streamdown components={components}>{content}</Streamdown>
</div>
)
}