feat: live feed toggle
This commit is contained in:
parent
89bb9ad2d0
commit
917fcd9839
26 changed files with 130 additions and 26 deletions
28
src/components/LiveFeedToggle/index.tsx
Normal file
28
src/components/LiveFeedToggle/index.tsx
Normal 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>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue