apprev/components-jsx/ActionRow.tsx
2025-05-15 07:10:53 -04:00

13 lines
487 B
TypeScript

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