move stuff around until it feels right

This commit is contained in:
MapleLeaf
2021-12-26 12:06:06 -06:00
parent d10618e3c1
commit 894e6abb26
35 changed files with 30 additions and 22 deletions

View File

@@ -0,0 +1,25 @@
import React from "react"
import { ReacordElement } from "../element.js"
import { EmbedChildNode } from "./embed-child.js"
import type { EmbedOptions } from "./embed-options"
export type EmbedTitleProps = {
children: string
url?: string
}
export function EmbedTitle(props: EmbedTitleProps) {
return (
<ReacordElement
props={props}
createNode={() => new EmbedTitleNode(props)}
/>
)
}
class EmbedTitleNode extends EmbedChildNode<EmbedTitleProps> {
override modifyEmbedOptions(options: EmbedOptions): void {
options.title = this.props.children
options.url = this.props.url
}
}