stargaze-studio/utils/layout.ts
2022-07-13 16:56:36 +03:00

14 lines
370 B
TypeScript

import type { ComponentType } from 'react'
export interface PageMetadata extends Record<string, unknown> {
center?: boolean
}
export const getComponentMetadata = (Component: any) => {
return Component.metadata as PageMetadata
}
export const withMetadata = (element: ComponentType<any>, metadata: PageMetadata) => {
return Object.assign(element, { metadata })
}