mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 06:10:22 +00:00
17 lines
365 B
TypeScript
17 lines
365 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
|