migrate to cv2 jsx

This commit is contained in:
nin0 2025-05-16 06:16:52 -04:00
parent 6858283ecc
commit dcd22a9d8c
Signed by: nin0
SSH key fingerprint: SHA256:NOoDnFVvZNFvqfXCIhzr6oCTDImZAbTTuyAysZ8Ufk8
18 changed files with 101 additions and 122 deletions

View file

@ -2,12 +2,12 @@ import { ComponentTypes, MessageActionRow, MessageActionRowComponent } from "oce
import { childrenToArray } from "./utils";
export type ActionRowProps = Omit<MessageActionRow, "type" | "components"> & { children?: MessageActionRowComponent | MessageActionRowComponent[] };
export type ActionRowProps = Omit<MessageActionRow, "type" | "components"> & { children: MessageActionRowComponent | MessageActionRowComponent[]; };
export function ActionRow(props: ActionRowProps): MessageActionRow {
export function ActionRow({ children, ...props }: ActionRowProps): MessageActionRow {
return {
type: ComponentTypes.ACTION_ROW,
components: childrenToArray(props.children),
components: childrenToArray(children),
...props
};
}