headplane/app/components/Footer.tsx

72 lines
1.7 KiB
TypeScript
Raw Normal View History

2025-05-04 14:43:40 -04:00
import { CircleX } from 'lucide-react';
2024-12-31 10:30:14 +05:30
import Link from '~/components/Link';
2025-01-28 17:46:16 -05:00
import cn from '~/utils/cn';
2024-12-08 13:27:51 -05:00
interface FooterProps {
2024-12-31 10:30:14 +05:30
url: string;
debug: boolean;
2025-05-04 14:43:40 -04:00
healthy: boolean;
2024-12-08 13:27:51 -05:00
}
2025-05-04 14:43:40 -04:00
export default function Footer({ url, debug, healthy }: FooterProps) {
2024-12-08 13:27:51 -05:00
return (
2024-12-31 10:30:14 +05:30
<footer
className={cn(
2025-05-04 14:43:40 -04:00
'fixed w-full bottom-0 left-0 z-40 h-12',
'flex items-center justify-center',
'bg-headplane-50 dark:bg-headplane-950',
2025-01-18 18:42:49 +00:00
'dark:border-t dark:border-headplane-800',
2024-12-31 10:30:14 +05:30
)}
>
2025-05-04 14:43:40 -04:00
<div
className={cn(
'grid grid-rows-1 items-center container mx-auto',
!healthy && 'md:grid-cols-[1fr_auto] grid-cols-1',
)}
>
<div
className={cn('text-xs leading-none', !healthy && 'hidden md:block')}
2024-12-08 13:27:51 -05:00
>
2025-05-04 14:43:40 -04:00
<p>
Headplane is free. Please consider{' '}
<Link
to="https://github.com/sponsors/tale"
name="Aarnav's GitHub Sponsors"
>
donating
</Link>{' '}
to support development.{' '}
</p>
<p className="opacity-75">
Version: {__VERSION__}
{' — '}
Connecting to{' '}
<button
type="button"
tabIndex={0} // Allows keyboard focus
className={cn(
'blur-sm hover:blur-none focus:blur-none transition',
'focus:outline-none focus:ring-2 rounded-sm',
)}
>
{url}
</button>
{debug && ' (Debug mode enabled)'}
</p>
</div>
{!healthy ? (
<div
className={cn(
'flex gap-1.5 items-center p-2 rounded-xl text-sm',
'bg-red-500 text-white font-semibold',
)}
>
<CircleX size={16} strokeWidth={3} />
<p className="text-nowrap">Headscale is unreachable</p>
</div>
) : undefined}
</div>
2024-12-08 13:27:51 -05:00
</footer>
2024-12-31 10:30:14 +05:30
);
2024-12-08 13:27:51 -05:00
}