feat: live feed toggle

This commit is contained in:
codytseng 2026-01-04 20:42:20 +08:00
parent 89bb9ad2d0
commit 917fcd9839
26 changed files with 130 additions and 26 deletions

View file

@ -0,0 +1,28 @@
import { Button } from '@/components/ui/button'
import { cn } from '@/lib/utils'
import { useUserPreferences } from '@/providers/UserPreferencesProvider'
import { Radio } from 'lucide-react'
import { useTranslation } from 'react-i18next'
export function LiveFeedToggle() {
const { t } = useTranslation()
const { enableLiveFeed, updateEnableLiveFeed } = useUserPreferences()
return (
<Button
variant="ghost"
size="titlebar-icon"
title={t(enableLiveFeed ? 'Disable live feed' : 'Enable live feed')}
onClick={() => updateEnableLiveFeed(!enableLiveFeed)}
>
<Radio
className={cn(
'size-4',
enableLiveFeed
? 'text-green-400 focus:text-green-300 animate-pulse'
: 'text-muted-foreground focus:text-foreground'
)}
/>
</Button>
)
}