2023-07-04 17:08:32 +00:00
|
|
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
|
|
|
|
|
|
|
export default ((component?: QuartzComponent) => {
|
|
|
|
if (component) {
|
|
|
|
const Component = component
|
2024-02-14 04:53:44 +00:00
|
|
|
const DesktopOnly: QuartzComponent = (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
|