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