import { Bookmark, BookmarkCheck, Check, CheckCircle2, Loader2, Plus, X } from 'lucide-react' import MSheet from '../../mobile/components/MSheet' import MIconBtn from '../../mobile/components/MIconBtn' import { useTranslation } from '../../i18n' import { STATUS_META, nextStatus } from '../../pages/collections/collectionsModel' import { VISITED_EVERYWHERE_BUSY, useSaveToCollection } from './useSaveToCollection' /** * Mobile counterpart of SaveToCollectionModal — the same store-driven list * picker (load lists + membership, toggle the place in/out of each), dressed in * the mobile design language (MSheet card, m-* tokens) so it matches the place * detail sheet. Rendered instead of the desktop modal on phones (see App.tsx). */ export default function MSaveToCollectionSheet() { const { target, close, lists, loading, busyId, savedByCollection, unvisited, handleStatus, handleVisitedEverywhere, handleToggle, openCollections } = useSaveToCollection() const { t } = useTranslation() return ( {/* Header — mirrors the place detail sheet: icon + title + target name + close */}
{t('collections.pickList')}
{target?.name && (
{target.name}
)}
{loading ? (
) : lists.length === 0 ? (

{t('collections.noListsYet')}

) : ( lists.map(list => { const entry = savedByCollection.get(list.id) const saved = !!entry const busy = busyId === list.id const statusMeta = entry ? STATUS_META[entry.status] : null const StatusIcon = statusMeta?.icon return ( ) }) )}
{unvisited.length > 0 && (
)} {lists.length > 0 && (
)}
) }