mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 01:06:23 +02:00
17 lines
425 B
TypeScript
17 lines
425 B
TypeScript
|
|
"use client";
|
||
|
|
|
||
|
|
import type { ReactNode } from "react";
|
||
|
|
import { usePlatform } from "@/hooks/use-platform";
|
||
|
|
|
||
|
|
export function DesktopOnly({ children }: { children: ReactNode }) {
|
||
|
|
const { isDesktop } = usePlatform();
|
||
|
|
if (!isDesktop) return null;
|
||
|
|
return <>{children}</>;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function WebOnly({ children }: { children: ReactNode }) {
|
||
|
|
const { isWeb } = usePlatform();
|
||
|
|
if (!isWeb) return null;
|
||
|
|
return <>{children}</>;
|
||
|
|
}
|