Files
katelyatv/src/components/Ipv6Button.tsx
T

21 lines
1.0 KiB
TypeScript

'use client';
export default function Ipv6Button({ forceShow = false, compact = false, light = false }: { forceShow?: boolean; compact?: boolean; light?: boolean }) {
const cls = forceShow
? light
? 'flex shrink-0 items-center gap-1 rounded-lg px-2 py-1.5 text-xs font-medium text-gray-700 hover:bg-purple-100/40 hover:text-purple-600 dark:text-gray-300 transition-colors duration-200'
: 'flex shrink-0 items-center gap-1.5 rounded-lg px-2 py-1.5 text-xs font-medium text-gray-200 hover:bg-white/10 hover:text-white transition-colors duration-200'
: 'hidden md:flex shrink-0 items-center gap-1.5 rounded-lg px-2.5 py-2 text-sm font-medium text-gray-700 hover:bg-purple-100/30 hover:text-purple-600 dark:text-gray-300 dark:hover:bg-purple-500/10 transition-colors duration-200';
return (
<button
onClick={() => {
location.href = '/ipv6';
}}
title='切换 IPv4 / IPv6 线路'
className={cls}
>
🌐 {compact ? 'IPV4/IPV6' : 'IPV4/IPV6'}
</button>
);
}