move stuff around

This commit is contained in:
MapleLeaf
2021-12-26 22:57:17 -06:00
parent 5ed8ea059f
commit 349fff1bcb
29 changed files with 180 additions and 171 deletions

View File

@@ -0,0 +1,30 @@
import React from "react"
import { ReacordElement } from "../../internal/element.js"
import { EmbedChildNode } from "./embed-child.js"
import type { EmbedOptions } from "./embed-options"
export type EmbedAuthorProps = {
name?: string
children?: string
url?: string
iconUrl?: string
}
export function EmbedAuthor(props: EmbedAuthorProps) {
return (
<ReacordElement
props={props}
createNode={() => new EmbedAuthorNode(props)}
/>
)
}
class EmbedAuthorNode extends EmbedChildNode<EmbedAuthorProps> {
override modifyEmbedOptions(options: EmbedOptions): void {
options.author = {
name: this.props.name ?? this.props.children ?? "",
url: this.props.url,
icon_url: this.props.iconUrl,
}
}
}