13 lines
463 B
TypeScript
13 lines
463 B
TypeScript
import { ComponentTypes, MediaGalleryComponent } from "oceanic.js";
|
|
|
|
import { childrenToArray } from "./utils";
|
|
|
|
export type MediaGalleryProps = Omit<MediaGalleryComponent, "type" | "items"> & { children: MediaGalleryComponent["items"]; };
|
|
|
|
export function MediaGallery({ children, ...props }: MediaGalleryProps): MediaGalleryComponent {
|
|
return {
|
|
type: ComponentTypes.MEDIA_GALLERY,
|
|
items: childrenToArray(children),
|
|
...props
|
|
};
|
|
}
|