mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-22 19:46:23 +00:00
21 lines
654 B
TypeScript
21 lines
654 B
TypeScript
|
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
||
|
|
||
|
export default ((component?: QuartzComponent) => {
|
||
|
if (component) {
|
||
|
const Component = component
|
||
|
function DesktopOnly(props: QuartzComponentProps) {
|
||
|
return <div class="desktop-only">
|
||
|
<Component {...props} />
|
||
|
</div>
|
||
|
}
|
||
|
|
||
|
DesktopOnly.displayName = component.displayName
|
||
|
DesktopOnly.afterDOMLoaded = component?.afterDOMLoaded
|
||
|
DesktopOnly.beforeDOMLoaded = component?.beforeDOMLoaded
|
||
|
DesktopOnly.css = component?.css
|
||
|
return DesktopOnly
|
||
|
} else {
|
||
|
return () => <></>
|
||
|
}
|
||
|
}) satisfies QuartzComponentConstructor
|