import React from 'react'; import { Link } from 'react-router-dom'; import { useForum } from '@/contexts/ForumContext'; import { Layout, MessageSquare, RefreshCw, Loader2 } from 'lucide-react'; import { CreateCellDialog } from './CreateCellDialog'; import { Button } from '@/components/ui/button'; import { CypherImage } from './ui/CypherImage'; const CellList = () => { const { cells, isInitialLoading, posts, refreshData, isRefreshing } = useForum(); if (isInitialLoading) { return (

Loading Cells...

Connecting to the network and fetching data...

); } const getPostCount = (cellId: string) => { return posts.filter(post => post.cellId === cellId).length; }; return (

Cells

{cells.length === 0 ? (
No cells found. Be the first to create one!
) : ( cells.map((cell) => (

{cell.name}

{cell.description}

{getPostCount(cell.id)} threads
)) )}
); }; export default CellList;