feat: 💨
This commit is contained in:
@@ -7,6 +7,7 @@ import { useRelaySets } from '@/providers/RelaySetsProvider'
|
|||||||
import { Circle, CircleCheck } from 'lucide-react'
|
import { Circle, CircleCheck } from 'lucide-react'
|
||||||
import { useTranslation } from 'react-i18next'
|
import { useTranslation } from 'react-i18next'
|
||||||
import RelaySetCard from '../RelaySetCard'
|
import RelaySetCard from '../RelaySetCard'
|
||||||
|
import SaveRelayDropdownMenu from '../SaveRelayDropdownMenu'
|
||||||
|
|
||||||
export default function FeedSwitcher({ close }: { close?: () => void }) {
|
export default function FeedSwitcher({ close }: { close?: () => void }) {
|
||||||
const { t } = useTranslation()
|
const { t } = useTranslation()
|
||||||
@@ -50,6 +51,7 @@ export default function FeedSwitcher({ close }: { close?: () => void }) {
|
|||||||
switchFeed('temporary')
|
switchFeed('temporary')
|
||||||
close?.()
|
close?.()
|
||||||
}}
|
}}
|
||||||
|
controls={<SaveRelayDropdownMenu urls={temporaryRelayUrls} />}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
{relaySets
|
{relaySets
|
||||||
@@ -76,22 +78,27 @@ function FeedSwitcherItem({
|
|||||||
itemName,
|
itemName,
|
||||||
isActive,
|
isActive,
|
||||||
temporary = false,
|
temporary = false,
|
||||||
onClick
|
onClick,
|
||||||
|
controls
|
||||||
}: {
|
}: {
|
||||||
itemName: string
|
itemName: string
|
||||||
isActive: boolean
|
isActive: boolean
|
||||||
temporary?: boolean
|
temporary?: boolean
|
||||||
onClick: () => void
|
onClick: () => void
|
||||||
|
controls?: React.ReactNode
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
className={`w-full border rounded-lg p-4 ${isActive ? 'border-highlight bg-highlight/5' : 'clickable'} ${temporary ? 'border-dashed' : ''}`}
|
className={`w-full border rounded-lg p-4 ${isActive ? 'border-highlight bg-highlight/5' : 'clickable'} ${temporary ? 'border-dashed' : ''}`}
|
||||||
onClick={onClick}
|
onClick={onClick}
|
||||||
>
|
>
|
||||||
<div className="flex space-x-2 items-center">
|
<div className="flex justify-between items-center">
|
||||||
|
<div className="flex gap-2 items-center">
|
||||||
<FeedToggle isActive={isActive} />
|
<FeedToggle isActive={isActive} />
|
||||||
<div className="font-semibold">{itemName}</div>
|
<div className="font-semibold">{itemName}</div>
|
||||||
</div>
|
</div>
|
||||||
|
{controls}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user