import { type FC } from 'react'; import { CrossCircledIcon } from '@radix-ui/react-icons'; import { useBookmarkContext } from '~/Providers/BookmarkContext'; import { BookmarkItems, BookmarkItem } from '~/components/Bookmarks'; import { useLocalize } from '~/hooks'; const BookmarkNavItems: FC<{ tags: string[]; setTags: (tags: string[]) => void; }> = ({ tags = [], setTags }) => { const { bookmarks } = useBookmarkContext(); const localize = useLocalize(); const getUpdatedSelected = (tag: string) => { if (tags.some((selectedTag) => selectedTag === tag)) { return tags.filter((selectedTag) => selectedTag !== tag); } else { return [...tags, tag]; } }; const handleSubmit = (tag?: string) => { if (tag === undefined) { return; } const updatedSelected = getUpdatedSelected(tag); setTags(updatedSelected); return; }; const clear = () => { setTags([]); return; }; if (bookmarks.length === 0) { return (