import React from "react" import { ReacordElement } from "../element.js" import { EmbedChildNode } from "./embed-child.js" import type { EmbedOptions } from "./embed-options" export type EmbedFooterProps = { text?: string children?: string iconUrl?: string timestamp?: string | number | Date } export function EmbedFooter(props: EmbedFooterProps) { return ( new EmbedFooterNode(props)} /> ) } class EmbedFooterNode extends EmbedChildNode { override modifyEmbedOptions(options: EmbedOptions): void { options.footer = { text: this.props.text ?? this.props.children ?? "", icon_url: this.props.iconUrl, } options.timestamp = this.props.timestamp ? new Date(this.props.timestamp).toISOString() : undefined } }