The Node.js® Website
at main 361 B view raw
1'use client'; 2 3import type { FC } from 'react'; 4 5import { useDetectOS } from '@/hooks'; 6 7type WithCurrentOS = { 8 children: FC<{ currentOS: ReturnType<typeof useDetectOS> }>; 9}; 10 11const WithCurrentOS: FC<WithCurrentOS> = ({ children: Component }) => { 12 const osData = useDetectOS(); 13 14 return <Component currentOS={osData} />; 15}; 16 17export default WithCurrentOS;