mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-18 14:39:55 +02:00
chore: editor images
This commit is contained in:
@@ -5,38 +5,39 @@ import { BubbleMenu } from "./components/bubble-menu"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { useLaEditor, UseLaEditorProps } from "./hooks/use-la-editor"
|
||||
import { MeasuredContainer } from "./components/measured-container"
|
||||
import { LaAccount, PersonalPage } from "~/lib/schema"
|
||||
|
||||
export interface LaEditorProps extends UseLaEditorProps {
|
||||
value?: Content
|
||||
className?: string
|
||||
editorContentClassName?: string
|
||||
me: LaAccount
|
||||
personalPage: PersonalPage
|
||||
}
|
||||
|
||||
export const LaEditor = React.memo(
|
||||
React.forwardRef<HTMLDivElement, LaEditorProps>(
|
||||
({ className, editorContentClassName, ...props }, ref) => {
|
||||
const editor = useLaEditor(props)
|
||||
export const LaEditor = React.forwardRef<HTMLDivElement, LaEditorProps>(
|
||||
({ className, editorContentClassName, me, personalPage, ...props }, ref) => {
|
||||
const editor = useLaEditor({ ...props, me, personalPage })
|
||||
|
||||
if (!editor) {
|
||||
return null
|
||||
}
|
||||
if (!editor) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<MeasuredContainer
|
||||
as="div"
|
||||
name="editor"
|
||||
className={cn("relative flex h-full w-full grow flex-col", className)}
|
||||
ref={ref}
|
||||
>
|
||||
<EditorContent
|
||||
editor={editor}
|
||||
className={cn("la-editor", editorContentClassName)}
|
||||
/>
|
||||
<BubbleMenu editor={editor} />
|
||||
</MeasuredContainer>
|
||||
)
|
||||
},
|
||||
),
|
||||
return (
|
||||
<MeasuredContainer
|
||||
as="div"
|
||||
name="editor"
|
||||
className={cn("relative flex h-full w-full grow flex-col", className)}
|
||||
ref={ref}
|
||||
>
|
||||
<EditorContent
|
||||
editor={editor}
|
||||
className={cn("la-editor", editorContentClassName)}
|
||||
/>
|
||||
<BubbleMenu editor={editor} />
|
||||
</MeasuredContainer>
|
||||
)
|
||||
},
|
||||
)
|
||||
|
||||
LaEditor.displayName = "LaEditor"
|
||||
|
||||
Reference in New Issue
Block a user