add JSX components v2
This commit is contained in:
parent
b5dd0ed413
commit
4b1227149f
25 changed files with 1080 additions and 3 deletions
13
components-jsx/MediaGallery.tsx
Normal file
13
components-jsx/MediaGallery.tsx
Normal file
|
@ -0,0 +1,13 @@
|
|||
import { ComponentTypes, MediaGalleryComponent } from "oceanic.js";
|
||||
|
||||
import { childrenToArray } from "./utils";
|
||||
|
||||
export type MediaGalleryProps = Omit<MediaGalleryComponent, "type" | "items"> & { children: MediaGalleryComponent["items"] };
|
||||
|
||||
export function MediaGallery(props: MediaGalleryProps): MediaGalleryComponent {
|
||||
return {
|
||||
type: ComponentTypes.MEDIA_GALLERY,
|
||||
items: childrenToArray(props.children),
|
||||
...props
|
||||
};
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue