migrate to cv2 jsx
This commit is contained in:
parent
6858283ecc
commit
dcd22a9d8c
18 changed files with 101 additions and 122 deletions
|
@ -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
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue