mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
13 lines
362 B
TypeScript
13 lines
362 B
TypeScript
import { ReactNode } from 'react'
|
|
|
|
const PlatformDisplay: React.FC<PlatformDisplayProps> = ({ osx, children }:PlatformDisplayProps) => {
|
|
const isOSX = /(Mac|iPhone|iPod|iPad)/i.test(navigator.platform)
|
|
return <>{isOSX ? osx ?? children : children}</>
|
|
}
|
|
|
|
interface PlatformDisplayProps {
|
|
osx?: ReactNode
|
|
children: ReactNode
|
|
}
|
|
|
|
export default PlatformDisplay |