import { useState } from 'react'; import { User } from '@app/auth/components/user'; import { useStorage } from '@libs/storage/provider'; import { ArrowRightCircleIcon, CheckCircleIcon } from '@shared/icons'; import { WidgetKinds, useWidgets } from '@stores/widgets'; import { Widget } from '@utils/types'; export function FeedWidgetForm({ params }: { params: Widget }) { const { db } = useStorage(); const [setWidget, removeWidget] = useWidgets((state) => [ state.setWidget, state.removeWidget, ]); const [title, setTitle] = useState(''); const [groups, setGroups] = useState>([]); // toggle follow state const toggleGroup = (pubkey: string) => { const arr = groups.includes(pubkey) ? groups.filter((i) => i !== pubkey) : [...groups, pubkey]; setGroups(arr); }; const cancel = () => { removeWidget(db, params.id); }; const submit = async () => { setWidget(db, { kind: WidgetKinds.feed, title: title || 'Group', content: JSON.stringify(groups), }); // remove temp widget removeWidget(db, params.id); }; return (

Choose account you want to add to group feeds

setTitle(e.target.value)} placeholder="Title" className="relative h-11 w-full rounded-lg bg-white/10 px-3 py-1 text-white !outline-none backdrop-blur-xl placeholder:text-white/50" />
{db.account.network.map((item: string) => ( ))}
); }