2023-07-05 00:08:32 +07:00
|
|
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
|
|
|
|
|
|
|
export default ((component?: QuartzComponent) => {
|
|
|
|
if (component) {
|
|
|
|
const Component = component
|
|
|
|
function MobileOnly(props: QuartzComponentProps) {
|
2023-07-05 06:48:36 +07:00
|
|
|
return <Component displayClass="mobile-only" {...props} />
|
2023-07-05 00:08:32 +07:00
|
|
|
}
|
|
|
|
|
|
|
|
MobileOnly.displayName = component.displayName
|
|
|
|
MobileOnly.afterDOMLoaded = component?.afterDOMLoaded
|
|
|
|
MobileOnly.beforeDOMLoaded = component?.beforeDOMLoaded
|
|
|
|
MobileOnly.css = component?.css
|
|
|
|
return MobileOnly
|
|
|
|
} else {
|
|
|
|
return () => <></>
|
|
|
|
}
|
|
|
|
}) satisfies QuartzComponentConstructor
|