// Posts list — grid + filters. const { useState: useStatePo } = React; function Posts({ org, data, onOpen }) { const { Button, IconButton, Card, Badge, Pill, TextInput, SectionHead, EmptyState } = window.UI; const I = window.Icons; const { SlideThumb } = window.Carousel; const [filter, setFilter] = useStatePo('all'); const [net, setNet] = useStatePo('all'); const [q, setQ] = useStatePo(''); const filtered = data.posts.filter((p) => { if (filter !== 'all' && p.status !== filter) return false; if (net !== 'all') { if (net === 'ig' && !(p.network === 'ig' || p.network === 'both')) return false; if (net === 'tg' && !(p.network === 'tg' || p.network === 'both')) return false; } if (q && !p.title.toLowerCase().includes(q.toLowerCase())) return false; return true; }); return (