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, MediaGalleryComponent } from "oceanic.js";
|
|||
|
||||
import { childrenToArray } from "./utils";
|
||||
|
||||
export type MediaGalleryProps = Omit<MediaGalleryComponent, "type" | "items"> & { children: MediaGalleryComponent["items"] };
|
||||
export type MediaGalleryProps = Omit<MediaGalleryComponent, "type" | "items"> & { children: MediaGalleryComponent["items"]; };
|
||||
|
||||
export function MediaGallery(props: MediaGalleryProps): MediaGalleryComponent {
|
||||
export function MediaGallery({ children, ...props }: MediaGalleryProps): MediaGalleryComponent {
|
||||
return {
|
||||
type: ComponentTypes.MEDIA_GALLERY,
|
||||
items: childrenToArray(props.children),
|
||||
items: childrenToArray(children),
|
||||
...props
|
||||
};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue