Skip to content

Commit 0c4cdea

Browse files
committed
feat(components): add OfflineNotice component
1 parent 08f6ffa commit 0c4cdea

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import React from 'react';
2+
import { FaWifi } from 'react-icons/fa';
3+
import { useOnlineStatus } from '../../hooks/useOnlineStatus';
4+
const OfflineNotice: React.FC = () => {
5+
const isOnline = useOnlineStatus();
6+
if (isOnline) return null;
7+
return (
8+
<div className='fixed top-0 left-0 right-0 z-[200] bg-red-500 text-white text-center py-2 text-sm font-medium flex items-center justify-center gap-2'>
9+
<FaWifi /><span>You are offline. Some features may not work.</span>
10+
</div>
11+
);
12+
};
13+
export default OfflineNotice;

0 commit comments

Comments
 (0)