mirror of
https://github.com/alrayyes/wiki.git
synced 2024-11-23 03:56:23 +00:00
21c6bbf302
Signed-off-by: Aaron <29749331+aarnphm@users.noreply.github.com>
18 lines
654 B
TypeScript
18 lines
654 B
TypeScript
import { QuartzComponent, QuartzComponentConstructor, QuartzComponentProps } from "./types"
|
|
|
|
export default ((component?: QuartzComponent) => {
|
|
if (component) {
|
|
const Component = component
|
|
const DesktopOnly: QuartzComponent = (props: QuartzComponentProps) => {
|
|
return <Component displayClass="desktop-only" {...props} />
|
|
}
|
|
|
|
DesktopOnly.displayName = component.displayName
|
|
DesktopOnly.afterDOMLoaded = component?.afterDOMLoaded
|
|
DesktopOnly.beforeDOMLoaded = component?.beforeDOMLoaded
|
|
DesktopOnly.css = component?.css
|
|
return DesktopOnly
|
|
} else {
|
|
return () => <></>
|
|
}
|
|
}) satisfies QuartzComponentConstructor
|