apprev/components-jsx/Container.tsx
2025-05-22 19:10:38 -04:00

18 lines
432 B
TypeScript

import { ComponentTypes, ContainerComponent } from "oceanic.js";
import { childrenToArray } from "./utils";
export type ContainerProps = Omit<ContainerComponent, "type" | "components"> & {
children: ContainerComponent["components"];
};
export function Container({
children,
...props
}: ContainerProps): ContainerComponent {
return {
type: ComponentTypes.CONTAINER,
components: childrenToArray(children),
...props
};
}