blob: 937da76a34ddaf28ad53bcdca29adcb66b2f023d [file] [log] [blame]
Krishyab5ef96d2025-06-05 13:57:05 +08001import React from 'react';
2import GroupItem from './GroupItem';
3import { useGroupStore } from '../../context/useGroupStore';
4
5const GroupList = () => {
6 const { groups, loading, error } = useGroupStore();
7
8 if (loading) return <p>加载中...</p>;
9 if (error) return <p className="error">{error}</p>;
10 if (!groups || groups.length === 0) return (
11 <div className="empty-state">
12 <p>没有找到匹配的兴趣小组</p>
13 <p>请尝试调整筛选条件或搜索关键词</p>
14 </div>
15 );
16
17 return (
18 <div className="group-list">
19 {groups.map(group => (
Krishyaaffe8102025-06-08 00:44:46 +080020 <GroupItem key={group.groupId} group={group} />
Krishyab5ef96d2025-06-05 13:57:05 +080021 ))}
22 </div>
23 );
24};
25
26export default GroupList;