import { useState } from 'react' import { motion, AnimatePresence } from 'framer-motion' import { X } from '../../lib/icons' import { normaliseLetterboxdListUrl } from '../../api/letterboxd' import { useLetterboxdLists } from '../../stores/letterboxd-lists-store' interface Props { open: boolean onClose: () => void } export default function LetterboxdAddModal({ open, onClose }: Props) { const add = useLetterboxdLists(s => s.add) const [url, setUrl] = useState('') const [error, setError] = useState(null) function save() { const norm = normaliseLetterboxdListUrl(url) if (!norm) { setError('That doesn\'t look like a Letterboxd list URL.') return } add(norm) setUrl('') setError(null) onClose() } return ( {open && ( e.stopPropagation()} className="relative w-full max-w-md rounded-2xl bg-surface ring-1 ring-border-strong shadow-[0_30px_80px_-20px_rgba(0,0,0,0.85)] p-5" >

Add a Letterboxd list

Paste the URL of any public Letterboxd list. We'll cross-check it against your library so missing entries are obvious.

{ setUrl(e.target.value) if (error) setError(null) }} onKeyDown={e => { if (e.key === 'Enter') save() }} placeholder="https://letterboxd.com/USER/list/SLUG/" autoFocus className="w-full h-10 px-3 rounded-md bg-elevated/60 ring-1 ring-border focus:ring-accent/50 outline-none text-[13px] tracking-tight" /> {error && (

{error}

)}
)}
) }