@armoyu/ui 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (149) hide show
  1. package/dist/app/layout.d.ts.map +1 -1
  2. package/dist/app/layout.js +16 -13
  3. package/dist/app/layout.js.map +1 -1
  4. package/dist/components/Button.d.ts +7 -7
  5. package/dist/components/Button.js +15 -15
  6. package/dist/components/GenderStatsBar.d.ts +5 -5
  7. package/dist/components/GenderStatsBar.js +7 -7
  8. package/dist/components/RollingNumber.js +3 -3
  9. package/dist/components/RollingNumber.js.map +1 -1
  10. package/dist/components/Slider.d.ts +10 -10
  11. package/dist/components/Slider.js +35 -35
  12. package/dist/components/StatsGrid.d.ts +5 -5
  13. package/dist/components/StatsGrid.js +13 -13
  14. package/dist/components/ViewModeToggle.d.ts +7 -7
  15. package/dist/components/ViewModeToggle.js +9 -9
  16. package/dist/components/modules/auth/Dashboard.d.ts +1 -1
  17. package/dist/components/modules/auth/Dashboard.js +250 -250
  18. package/dist/components/modules/auth/MediaLightbox.d.ts +13 -13
  19. package/dist/components/modules/auth/MediaLightbox.js +46 -46
  20. package/dist/components/modules/auth/PostCard.d.ts +24 -24
  21. package/dist/components/modules/auth/PostCard.js +112 -112
  22. package/dist/components/modules/auth/PostInteractionsModal.d.ts +11 -11
  23. package/dist/components/modules/auth/PostInteractionsModal.js +12 -12
  24. package/dist/components/modules/auth/RepostModal.d.ts +21 -21
  25. package/dist/components/modules/auth/RepostModal.js +75 -75
  26. package/dist/components/modules/auth/SidebarLeft.d.ts +1 -1
  27. package/dist/components/modules/auth/SidebarLeft.js +40 -40
  28. package/dist/components/modules/auth/Stories.d.ts +1 -1
  29. package/dist/components/modules/auth/Stories.js +15 -15
  30. package/dist/components/modules/auth/StoryViewer.d.ts +9 -9
  31. package/dist/components/modules/auth/StoryViewer.js +47 -47
  32. package/dist/components/modules/chat/ChatContainer.d.ts +1 -1
  33. package/dist/components/modules/chat/ChatContainer.js +196 -196
  34. package/dist/components/modules/chat/ChatInput.d.ts +4 -4
  35. package/dist/components/modules/chat/ChatInput.js +30 -30
  36. package/dist/components/modules/chat/ChatList.d.ts +6 -6
  37. package/dist/components/modules/chat/ChatList.js +51 -51
  38. package/dist/components/modules/chat/ChatMessage.d.ts +11 -11
  39. package/dist/components/modules/chat/ChatMessage.js +6 -6
  40. package/dist/components/modules/chat/ChatNotes.d.ts +1 -1
  41. package/dist/components/modules/chat/ChatNotes.js +11 -11
  42. package/dist/components/modules/community/GroupHeader.d.ts +10 -10
  43. package/dist/components/modules/community/GroupHeader.js +17 -17
  44. package/dist/components/modules/community/GroupMenu.d.ts +9 -9
  45. package/dist/components/modules/community/GroupMenu.js +16 -16
  46. package/dist/components/modules/community/SchoolCard.d.ts +6 -6
  47. package/dist/components/modules/community/SchoolCard.js +7 -7
  48. package/dist/components/modules/community/SurveyCard.d.ts +6 -6
  49. package/dist/components/modules/community/SurveyCard.js +35 -35
  50. package/dist/components/modules/forum/ForumBoard.d.ts +16 -16
  51. package/dist/components/modules/forum/ForumBoard.js +6 -6
  52. package/dist/components/modules/forum/ForumPost.d.ts +13 -13
  53. package/dist/components/modules/forum/ForumPost.js +5 -5
  54. package/dist/components/modules/forum/NewTopicModal.d.ts +7 -7
  55. package/dist/components/modules/forum/NewTopicModal.js +26 -26
  56. package/dist/components/modules/forum/TopicItem.d.ts +15 -15
  57. package/dist/components/modules/forum/TopicItem.js +6 -6
  58. package/dist/components/modules/galleries/GalleryCard.d.ts +9 -9
  59. package/dist/components/modules/galleries/GalleryCard.js +5 -5
  60. package/dist/components/modules/giveaways/GiveawayCard.d.ts +9 -9
  61. package/dist/components/modules/giveaways/GiveawayCard.js +6 -6
  62. package/dist/components/modules/groups/ApplicationModal.d.ts +7 -7
  63. package/dist/components/modules/groups/ApplicationModal.js +27 -27
  64. package/dist/components/modules/groups/GroupCard.d.ts +12 -12
  65. package/dist/components/modules/groups/GroupCard.js +6 -6
  66. package/dist/components/modules/guest/Introduction.d.ts +1 -1
  67. package/dist/components/modules/guest/Introduction.js +13 -13
  68. package/dist/components/modules/magaza/BackToStore.d.ts +1 -1
  69. package/dist/components/modules/magaza/BackToStore.js +10 -10
  70. package/dist/components/modules/magaza/StoreHeader.d.ts +5 -5
  71. package/dist/components/modules/magaza/StoreHeader.js +8 -8
  72. package/dist/components/modules/news/NewsCard.d.ts +11 -11
  73. package/dist/components/modules/news/NewsCard.js +6 -6
  74. package/dist/components/modules/news/NewsComments.d.ts +1 -1
  75. package/dist/components/modules/news/NewsComments.js +52 -52
  76. package/dist/components/modules/profile/CloudStorageModal.d.ts +8 -8
  77. package/dist/components/modules/profile/CloudStorageModal.js +31 -31
  78. package/dist/components/modules/profile/EditProfileModal.d.ts +8 -8
  79. package/dist/components/modules/profile/EditProfileModal.js +27 -27
  80. package/dist/components/modules/profile/ProfileContent.d.ts +4 -4
  81. package/dist/components/modules/profile/ProfileContent.js +70 -70
  82. package/dist/components/modules/profile/ProfileHeader.d.ts +7 -7
  83. package/dist/components/modules/profile/ProfileHeader.js +19 -19
  84. package/dist/components/modules/profile/ProfileStats.js +1 -1
  85. package/dist/components/modules/profile/ProfileStats.js.map +1 -1
  86. package/dist/components/modules/profile/TeamSelectorModal.d.ts +10 -10
  87. package/dist/components/modules/profile/TeamSelectorModal.js +16 -16
  88. package/dist/components/modules/stations/StationCard.d.ts +2 -2
  89. package/dist/components/modules/stations/StationCard.js +25 -25
  90. package/dist/components/modules/stations/StationQRModal.d.ts +9 -9
  91. package/dist/components/modules/stations/StationQRModal.js +12 -12
  92. package/dist/components/shared/FloatingChatButton.d.ts +4 -4
  93. package/dist/components/shared/FloatingChatButton.js +20 -20
  94. package/dist/components/shared/Footer.d.ts +1 -1
  95. package/dist/components/shared/Footer.js +9 -9
  96. package/dist/components/shared/Header.d.ts +1 -1
  97. package/dist/components/shared/Header.js +97 -97
  98. package/dist/components/shared/LoginModal.d.ts +4 -4
  99. package/dist/components/shared/LoginModal.js +69 -69
  100. package/dist/components/shared/MainLayoutWrapper.d.ts +3 -3
  101. package/dist/components/shared/MainLayoutWrapper.js +7 -7
  102. package/dist/components/shared/PageWidth.d.ts +5 -5
  103. package/dist/components/shared/PageWidth.js +13 -13
  104. package/dist/context/AuthContext.d.ts +18 -18
  105. package/dist/context/AuthContext.js +74 -74
  106. package/dist/context/CartContext.d.ts +16 -16
  107. package/dist/context/CartContext.js +63 -63
  108. package/dist/context/ChatContext.d.ts +12 -12
  109. package/dist/context/ChatContext.js +17 -17
  110. package/dist/context/LayoutContext.d.ts +10 -10
  111. package/dist/context/LayoutContext.js +16 -16
  112. package/dist/context/SocketContext.d.ts +12 -12
  113. package/dist/context/SocketContext.js +30 -30
  114. package/dist/context/ThemeContext.d.ts +10 -10
  115. package/dist/context/ThemeContext.js +39 -39
  116. package/dist/index.d.ts +65 -65
  117. package/dist/index.js +80 -80
  118. package/dist/lib/constants/educationData.d.ts +7 -7
  119. package/dist/lib/constants/educationData.js +117 -117
  120. package/dist/lib/constants/punishmentData.d.ts +29 -29
  121. package/dist/lib/constants/punishmentData.js +183 -183
  122. package/dist/lib/constants/seedData.d.ts +164 -164
  123. package/dist/lib/constants/seedData.js +694 -694
  124. package/dist/lib/constants/stationData.d.ts +13 -13
  125. package/dist/lib/constants/stationData.js +166 -166
  126. package/dist/lib/constants/surveyData.d.ts +2 -2
  127. package/dist/lib/constants/surveyData.js +49 -49
  128. package/dist/lib/constants/teamData.d.ts +12 -12
  129. package/dist/lib/constants/teamData.js +65 -65
  130. package/dist/types/stats.d.ts +17 -17
  131. package/dist/types/stats.js +1 -1
  132. package/next.config.ts +13 -13
  133. package/package.json +45 -46
  134. package/postcss.config.js +6 -6
  135. package/src/app/layout.tsx +67 -64
  136. package/src/app/page.tsx +101 -101
  137. package/src/components/RollingNumber.tsx +3 -3
  138. package/src/components/modules/profile/ProfileStats.tsx +4 -4
  139. package/src/components/showcase/CommunityTab.tsx +22 -22
  140. package/src/components/showcase/CorporateTab.tsx +38 -38
  141. package/src/components/showcase/GeneralTab.tsx +41 -41
  142. package/src/components/showcase/MessagesTab.tsx +26 -26
  143. package/src/components/showcase/ProfileTab.tsx +20 -20
  144. package/src/components/showcase/ShopTab.tsx +24 -24
  145. package/src/components/showcase/SocialTab.tsx +28 -28
  146. package/src/globals.css +187 -187
  147. package/src/lib/utils/numberFormat.ts +16 -16
  148. package/src/lib/utils/odpUtils.ts +51 -51
  149. package/src/types/index.ts +1 -1
@@ -1,251 +1,251 @@
1
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
- import { useState, useEffect, useRef, useMemo } from 'react';
3
- import { useSearchParams, useRouter } from 'next/navigation';
4
- import { useAuth } from '../../../context/AuthContext';
5
- import { useSocket } from '../../../context/SocketContext';
6
- import { PostCard } from './PostCard';
7
- import { Stories } from './Stories';
8
- import { SidebarLeft } from './SidebarLeft';
9
- import { CloudStorageModal } from '../profile/CloudStorageModal';
10
- import Link from 'next/link';
11
- import { postList, groupList } from '../../../lib/constants/seedData';
12
- import { Post } from '@armoyu/core';
13
- import { CheckCircle2 } from 'lucide-react';
14
- export function Dashboard() {
15
- const { user } = useAuth();
16
- const { on } = useSocket();
17
- const searchParams = useSearchParams();
18
- const router = useRouter();
19
- const focusedPostId = searchParams.get('post');
20
- const [isCloudModalOpen, setIsCloudModalOpen] = useState(false);
21
- const [isBioModalOpen, setIsBioModalOpen] = useState(false);
22
- const [tempBio, setTempBio] = useState(user?.bio || '');
23
- const [selectedMedia, setSelectedMedia] = useState([]);
24
- const [selectedTag, setSelectedTag] = useState(null);
25
- const [visibleCount, setVisibleCount] = useState(10);
26
- const [isLoadingMore, setIsLoadingMore] = useState(false);
27
- const { updateUser } = useAuth();
28
- const [posts, setPosts] = useState(postList);
29
- const [newPostsBuffer, setNewPostsBuffer] = useState([]);
30
- const [isAtTop, setIsAtTop] = useState(true);
31
- const [postContent, setPostContent] = useState('');
32
- const [isPosting, setIsPosting] = useState(false);
33
- const textareaRef = useRef(null);
34
- const handleBioSave = () => {
35
- if (user) {
36
- updateUser({
37
- ...user,
38
- bio: tempBio
39
- });
40
- setIsBioModalOpen(false);
41
- }
42
- };
43
- // Gündemdeki Etiketleri Dinamik Hesapla
44
- const trendingTags = useMemo(() => {
45
- const counts = {};
46
- posts.forEach(post => {
47
- post.hashtags?.forEach(tag => {
48
- counts[tag] = (counts[tag] || 0) + 1;
49
- });
50
- });
51
- return Object.entries(counts)
52
- .map(([name, count]) => ({ name, count }))
53
- .sort((a, b) => b.count - a.count)
54
- .slice(0, 5);
55
- }, [posts]);
56
- // Filtremele ve Pagination Mantığı
57
- const allFilteredPosts = useMemo(() => {
58
- // 1. Post ID filtresi (En yüksek öncelik)
59
- if (focusedPostId) {
60
- return posts.filter(p => p.id === focusedPostId);
61
- }
62
- // 2. Tag filtresi
63
- if (selectedTag) {
64
- return posts.filter(post => post.hashtags?.includes(selectedTag.replace('#', '')));
65
- }
66
- return posts;
67
- }, [posts, focusedPostId, selectedTag]);
68
- const visiblePosts = allFilteredPosts.slice(0, visibleCount);
69
- // Auto-resize logic for textarea
70
- useEffect(() => {
71
- if (textareaRef.current) {
72
- textareaRef.current.style.height = 'inherit';
73
- textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
74
- }
75
- }, [postContent]);
76
- useEffect(() => {
77
- const handleScroll = () => {
78
- setIsAtTop(window.scrollY < 150);
79
- };
80
- window.addEventListener('scroll', handleScroll);
81
- return () => window.removeEventListener('scroll', handleScroll);
82
- }, []);
83
- // Socket Listener for New Posts
84
- useEffect(() => {
85
- console.log('[Dashboard] Setting up socket listener for "post" event');
86
- const offPost = on('post', (data) => {
87
- console.log('[Dashboard] New socket post received!', data);
88
- const newPost = Post.fromJSON(data);
89
- setPosts(currentPosts => {
90
- // If this is a post from the CURRENT USER, find the pending version and replace it
91
- if (newPost.author?.username === user?.username) {
92
- // Check if there is a pending post (we look for matches in content and media count as a heuristic)
93
- const pendingIdx = currentPosts.findIndex(p => p.isPending && p.content === newPost.content);
94
- if (pendingIdx !== -1) {
95
- const updated = [...currentPosts];
96
- updated[pendingIdx] = newPost; // Replace pending with confirmed
97
- return updated;
98
- }
99
- }
100
- // Standard duplicate check
101
- if (currentPosts.some(p => p.id === newPost.id))
102
- return currentPosts;
103
- if (window.scrollY < 150) {
104
- return [newPost, ...currentPosts];
105
- }
106
- else {
107
- setNewPostsBuffer(prev => {
108
- if (prev.some(p => p.id === newPost.id))
109
- return prev;
110
- return [newPost, ...prev];
111
- });
112
- return currentPosts;
113
- }
114
- });
115
- });
116
- const offLike = on('post_like', (data) => {
117
- const { postId, newCount } = data;
118
- setPosts(currentPosts => currentPosts.map(p => {
119
- if (p.id === postId) {
120
- return {
121
- ...p,
122
- stats: { ...p.stats, likes: newCount }
123
- };
124
- }
125
- return p;
126
- }));
127
- });
128
- const offRepostCount = on('post_repost_count', (data) => {
129
- const { postId } = data;
130
- setPosts(currentPosts => currentPosts.map(p => {
131
- if (p.id === postId) {
132
- return {
133
- ...p,
134
- stats: { ...p.stats, reposts: (p.stats.reposts || 0) + 1 }
135
- };
136
- }
137
- return p;
138
- }));
139
- });
140
- return () => {
141
- offPost();
142
- offLike();
143
- offRepostCount();
144
- };
145
- }, [on]);
146
- const mergeNewPosts = () => {
147
- setPosts(prev => [...newPostsBuffer, ...prev]);
148
- setNewPostsBuffer([]);
149
- window.scrollTo({ top: 0, behavior: 'smooth' });
150
- };
151
- const { emit } = useSocket();
152
- const handleCreatePost = () => {
153
- try {
154
- if ((!postContent.trim() && selectedMedia.length === 0) || isPosting || !user) {
155
- return;
156
- }
157
- // 1. Create optimistic local post
158
- const tempId = 'p-temp-' + Date.now();
159
- const optimisticPost = new Post({
160
- id: tempId,
161
- author: user,
162
- content: postContent,
163
- media: selectedMedia,
164
- createdAt: 'Gönderiliyor...',
165
- stats: { likes: 0, comments: 0, shares: 0, reposts: 0 },
166
- hashtags: postContent.match(/#\w+/g)?.map(t => t.replace('#', '')) || [],
167
- isPending: true
168
- });
169
- // 2. Clear inputs & Add to state immediately
170
- const savedContent = postContent;
171
- const savedMedia = [...selectedMedia];
172
- setPosts(prev => [optimisticPost, ...prev]);
173
- setPostContent('');
174
- setSelectedMedia([]);
175
- console.log('[Dashboard] Optimistic post added, inputs cleared.');
176
- // 3. Prepare wire data
177
- const wireData = {
178
- id: 'p-' + Date.now(), // Real ID candidate
179
- author: {
180
- id: user.id,
181
- username: user.username,
182
- displayName: user.displayName,
183
- avatar: user.avatar,
184
- role: user.role,
185
- verified: user.verified,
186
- level: user.level
187
- },
188
- content: savedContent,
189
- media: savedMedia,
190
- createdAt: 'Şimdi',
191
- stats: { likes: 0, comments: 0, shares: 0, reposts: 0 },
192
- hashtags: savedContent.match(/#\w+/g)?.map(t => t.replace('#', '')) || []
193
- };
194
- // 4. Emit to socket server
195
- emit('post', wireData);
196
- }
197
- catch (error) {
198
- console.error('[Dashboard] Error in handleCreatePost:', error);
199
- }
200
- };
201
- // Sonsuz Kaydırma Trigger (Intersection Observer)
202
- const loaderRef = useRef(null);
203
- useEffect(() => {
204
- const observer = new IntersectionObserver((entries) => {
205
- if (entries[0].isIntersecting && !isLoadingMore && visibleCount < allFilteredPosts.length) {
206
- setIsLoadingMore(true);
207
- setTimeout(() => {
208
- setVisibleCount(prev => prev + 10);
209
- setIsLoadingMore(false);
210
- }, 800);
211
- }
212
- }, { threshold: 0.1 });
213
- if (loaderRef.current) {
214
- observer.observe(loaderRef.current);
215
- }
216
- return () => observer.disconnect();
217
- }, [isLoadingMore, visibleCount, allFilteredPosts.length]);
218
- return (_jsxs("div", { className: "w-full flex-1 flex gap-6 pb-20 animate-in fade-in slide-in-from-bottom-8 duration-700 items-start", children: [_jsx(SidebarLeft, {}), _jsxs("div", { className: "flex-1 flex flex-col pt-2", children: [_jsx(Stories, {}), _jsxs("div", { className: "glass-panel p-4 md:p-5 rounded-3xl border border-armoyu-card-border bg-armoyu-card-bg shadow-sm mb-8", children: [_jsxs("div", { className: "flex gap-4 items-start", children: [_jsx("img", { src: user?.avatar || "https://api.dicebear.com/7.x/avataaars/svg?seed=Armoyu", alt: "Avatar", className: "w-12 h-12 rounded-full border border-black/10 dark:border-white/10 shadow-sm mt-1" }), _jsxs("div", { className: "flex-1 flex flex-col gap-3", children: [_jsx("textarea", { ref: textareaRef, value: postContent, onChange: (e) => setPostContent(e.target.value), onKeyDown: (e) => {
219
- if (e.key === 'Enter' && !e.shiftKey) {
220
- e.preventDefault();
221
- handleCreatePost();
222
- }
223
- }, placeholder: "Neler yap\u0131yorsun, d\u00FC\u015F\u00FCncelerini payla\u015F...", className: "w-full bg-black/5 dark:bg-white/5 border border-black/10 dark:border-white/10 hover:border-black/20 dark:hover:border-white/20 rounded-2xl px-5 py-3 text-sm text-armoyu-text placeholder-armoyu-text-muted focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500 transition-all font-medium resize-none min-h-[44px] max-h-[300px] overflow-y-auto" }), selectedMedia.length > 0 && (_jsx("div", { className: "flex gap-2.5 overflow-x-auto pb-2 scrollbar-hide animate-in fade-in slide-in-from-left-4 duration-300", children: selectedMedia.map((media, idx) => (_jsxs("div", { className: "relative group shrink-0", children: [media.type === 'video' ? (_jsxs("div", { className: "w-24 h-24 rounded-2xl bg-black/20 flex items-center justify-center border border-white/10 overflow-hidden", children: [_jsx("video", { src: media.url, className: "w-full h-full object-cover opacity-60" }), _jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "white", children: _jsx("polygon", { points: "5 3 19 12 5 21 5 3" }) }) })] })) : (_jsx("img", { src: media.url, alt: "Preview", className: "w-24 h-24 rounded-2xl object-cover border border-white/10 shadow-md group-hover:scale-105 transition-transform" })), _jsx("button", { onClick: () => setSelectedMedia(prev => prev.filter((_, i) => i !== idx)), className: "absolute -top-1.5 -right-1.5 w-6 h-6 bg-red-500 text-white rounded-full flex items-center justify-center shadow-lg hover:bg-red-600 transition-colors z-10", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }, idx))) }))] })] }), _jsxs("div", { className: "flex justify-between items-center mt-3 pl-16", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx("button", { onClick: () => setIsCloudModalOpen(true), className: "flex items-center justify-center p-2.5 text-blue-500 hover:bg-blue-500/10 rounded-xl transition-colors shrink-0", title: "Cloud Medya Galerisini A\u00E7", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", stroke: "currentColor", strokeWidth: "1", strokeLinecap: "round", strokeLinejoin: "round", className: "text-blue-500", children: _jsx("path", { d: "M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" }) }) }), _jsx("button", { className: "p-2 text-armoyu-text-muted hover:text-blue-500 hover:bg-blue-500/10 rounded-full transition-colors", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), _jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), _jsx("polyline", { points: "21 15 16 10 5 21" })] }) }), _jsx("button", { className: "p-2 text-armoyu-text-muted hover:text-emerald-500 hover:bg-emerald-500/10 rounded-full transition-colors", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("path", { d: "M8 14s1.5 2 4 2 4-2 4-2" }), _jsx("line", { x1: "9", y1: "9", x2: "9.01", y2: "9" }), _jsx("line", { x1: "15", y1: "9", x2: "15.01", y2: "9" })] }) })] }), _jsx("button", { onClick: handleCreatePost, disabled: isPosting || (!postContent.trim() && selectedMedia.length === 0), className: "px-6 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-500 hover:to-blue-400 disabled:opacity-50 disabled:cursor-not-allowed text-white text-sm font-bold rounded-xl shadow-md transition-all active:scale-95", children: isPosting ? 'Gidiyor...' : 'Gönder' })] })] }), focusedPostId && (_jsxs("div", { className: "flex items-center justify-between bg-blue-600/10 border border-blue-600/20 p-5 rounded-3xl mb-6 animate-in fade-in zoom-in duration-500", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-full bg-blue-600/20 flex items-center justify-center text-blue-600", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M15 3h6v6" }), _jsx("path", { d: "M10 14 21 3" }), _jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })] }) }), _jsxs("div", { children: [_jsx("h4", { className: "text-sm font-black text-armoyu-text uppercase tracking-tight", children: "Tekil G\u00F6nderi Modu" }), _jsx("p", { className: "text-xs text-armoyu-text-muted font-bold", children: "\u015Eu an sadece bu bildirime ait payla\u015F\u0131m\u0131 g\u00F6r\u00FCyorsunuz." })] })] }), _jsx("button", { onClick: () => router.push('/'), className: "px-5 py-2 bg-blue-600 text-white text-xs font-black rounded-xl hover:bg-blue-500 shadow-md transition-all active:scale-95 uppercase tracking-widest", children: "T\u00FCm Ak\u0131\u015Fa D\u00F6n" })] })), newPostsBuffer.length > 0 && (_jsx("div", { className: "fixed bottom-12 left-1/2 -translate-x-1/2 z-[60] flex justify-center pointer-events-none", children: _jsxs("button", { onClick: mergeNewPosts, className: "pointer-events-auto flex items-center gap-3 px-8 py-3 bg-blue-600/95 backdrop-blur-xl text-white text-sm font-black rounded-full shadow-[0_15px_35px_rgba(37,99,235,0.45)] border border-white/30 hover:bg-blue-500 hover:scale-105 hover:-translate-y-1 transition-all animate-in slide-in-from-bottom-12 fade-in duration-500", children: [_jsx("div", { className: "flex -space-x-2", children: newPostsBuffer.slice(0, 3).map((p, i) => (_jsx("img", { src: p.author?.avatar, className: "w-7 h-7 rounded-full border-2 border-white shadow-sm bg-armoyu-card-bg" }, i))) }), _jsxs("span", { className: "whitespace-nowrap", children: [newPostsBuffer.length, " Yeni Payla\u015F\u0131m\u0131 G\u00F6r\u00FCnt\u00FCle"] }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "m18 15-6-6-6 6" }) })] }) })), _jsxs("div", { className: "space-y-6", children: [selectedTag && (_jsxs("div", { className: "flex items-center justify-between bg-blue-500/10 border border-blue-500/20 p-4 rounded-2xl animate-in fade-in slide-in-from-left-4 duration-300", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm font-bold text-armoyu-text-muted", children: "Filtrelenen Etiket:" }), _jsx("span", { className: "text-sm font-black text-blue-500", children: selectedTag })] }), _jsx("button", { onClick: () => { setSelectedTag(null); setVisibleCount(10); }, className: "text-xs font-bold text-red-500 hover:underline", children: "Filtreyi Temizle" })] })), visiblePosts.length > 0 ? (visiblePosts.map(post => (_jsx(PostCard, { ...post, onTagClick: (tag) => { setSelectedTag(tag); setVisibleCount(10); } }, post.id)))) : (_jsx("div", { className: "text-center py-20 bg-black/5 dark:bg-white/5 rounded-3xl border border-dashed border-armoyu-card-border", children: _jsx("p", { className: "text-armoyu-text-muted font-bold", children: "Bu etikete ait hen\u00FCz bir payla\u015F\u0131m yok." }) })), _jsx("div", { ref: loaderRef, className: "py-10 flex flex-col items-center justify-center gap-3", children: visibleCount < allFilteredPosts.length ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "w-8 h-8 border-4 border-blue-500/20 border-t-blue-500 rounded-full animate-spin" }), _jsx("p", { className: "text-xs font-bold text-armoyu-text-muted animate-pulse italic", children: "Daha fazla i\u00E7erik y\u00FCkleniyor..." })] })) : (_jsxs("div", { className: "flex items-center gap-4 opacity-50", children: [_jsx("div", { className: "h-px w-20 bg-armoyu-card-border" }), _jsx("span", { className: "text-[10px] uppercase font-black tracking-widest text-armoyu-text-muted", children: "T\u00FCm ak\u0131\u015F g\u00F6r\u00FCnt\u00FClendi" }), _jsx("div", { className: "h-px w-20 bg-armoyu-card-border" })] })) })] })] }), _jsxs("div", { className: "hidden lg:flex w-[320px] flex-col gap-6", children: [_jsxs("div", { className: "glass-panel p-6 rounded-3xl border border-armoyu-card-border bg-armoyu-card-bg group overflow-hidden relative", children: [_jsx("div", { className: "absolute -top-10 -right-10 w-32 h-32 bg-blue-500/5 rounded-full blur-3xl group-hover:bg-blue-500/10 transition-all duration-700" }), _jsxs("div", { className: "relative z-10", children: [_jsxs("h3", { className: "font-extrabold text-armoyu-text text-xl tracking-tight mb-6", children: ["Ho\u015F Geldin, ", _jsx("span", { className: "text-blue-500", children: user?.displayName?.split(' ')[0] })] }), (() => {
224
- const steps = [
225
- { id: 'avatar', label: 'Profil Fotoğrafı Ekle', completed: !!user?.avatar && !user.avatar.includes('seed=Armoyu'), icon: '🖼️' },
226
- { id: 'bio', label: 'Hakkında Yazısı Yaz', completed: !!user?.bio && user.bio.length > 5, icon: '✍️' },
227
- { id: 'verified', label: 'E-posta Onayla', completed: !!user?.verified, icon: '📧' },
228
- { id: 'groups', label: 'Bir Gruba Katıl', completed: (user?.groups?.length || 0) > 0, icon: '🛡️' }
229
- ];
230
- const totalPercentage = steps.reduce((acc, step) => acc + (step.completed ? 25 : 0), 0);
231
- const nextStep = steps.find(s => !s.completed);
232
- if (totalPercentage === 100) {
233
- return (_jsxs("div", { className: "flex items-center gap-2 animate-in fade-in duration-700", children: [_jsx(CheckCircle2, { size: 16, className: "text-emerald-500" }), _jsx("span", { className: "text-[10px] font-black text-emerald-500 uppercase tracking-widest", children: "T\u00FCm g\u00F6revler tamamland\u0131" })] }));
234
- }
235
- return (_jsxs("div", { className: "animate-in fade-in slide-in-from-top-4 duration-500", children: [_jsxs("div", { className: "flex items-center justify-between mb-4", children: [_jsx("span", { className: "text-[10px] font-black text-armoyu-text-muted uppercase tracking-widest", children: "Aktif G\u00F6revin" }), _jsxs("span", { className: "text-[10px] font-black text-blue-500 uppercase tracking-widest bg-blue-500/10 px-2 py-0.5 rounded", children: ["%", totalPercentage, " Tamamland\u0131"] })] }), _jsxs("button", { onClick: () => {
236
- if (nextStep?.id === 'bio') {
237
- setIsBioModalOpen(true);
238
- }
239
- else if (nextStep?.id === 'groups') {
240
- router.push('/gruplar');
241
- }
242
- else {
243
- router.push('/ayarlar/profil');
244
- }
245
- }, className: "w-full flex items-center gap-4 p-4 bg-black/20 hover:bg-blue-600 border border-white/5 rounded-2xl group/task transition-all active:scale-95 shadow-xl text-left", children: [_jsx("div", { className: "w-12 h-12 rounded-xl bg-white/5 flex items-center justify-center text-2xl group-hover/task:bg-white/20 transition-colors", children: nextStep?.icon }), _jsxs("div", { className: "flex-1", children: [_jsx("h4", { className: "text-sm font-black text-armoyu-text group-hover/task:text-white uppercase tracking-tight", children: nextStep?.label }), _jsx("p", { className: "text-[10px] font-bold text-armoyu-text-muted group-hover/task:text-white/80 uppercase tracking-widest mt-1 italic", children: "Hemen Tamamla \u2192" })] })] })] }));
246
- })()] })] }), (user?.groups?.length || 0) > 0 && (_jsxs("div", { className: "glass-panel p-6 rounded-3xl border border-armoyu-card-border bg-armoyu-card-bg transition-all animate-in fade-in zoom-in duration-500", children: [_jsxs("div", { className: "flex items-center justify-between mb-5", children: [_jsx("h3", { className: "font-extrabold text-armoyu-text text-lg", children: "Gruplar\u0131m" }), _jsxs("span", { className: "bg-blue-500/10 text-blue-500 text-[10px] font-black px-2 py-0.5 rounded-md uppercase", children: [(user?.groups?.length || 0), " Grup"] })] }), _jsx("div", { className: "space-y-4", children: user?.groups?.map((group, idx) => (_jsxs(Link, { href: `/gruplar/${group.name.toLowerCase().replace(/\s+/g, '-')}`, className: "flex items-center gap-3 group cursor-pointer p-1 rounded-xl hover:bg-black/5 dark:hover:bg-white/5 transition-colors", children: [_jsx("img", { src: group.logo, alt: group.name, className: "w-10 h-10 rounded-xl object-cover border border-black/5 shadow-sm group-hover:scale-105 transition-transform" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("h4", { className: "text-sm font-bold text-armoyu-text truncate group-hover:text-blue-500 transition-colors uppercase tracking-tight", children: group.name }), _jsxs("div", { className: "flex items-center gap-1.5 mt-0.5", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse" }), _jsxs("span", { className: "text-[10px] text-armoyu-text-muted truncate opacity-80 uppercase font-bold tracking-widest", children: [group.shortName, " \u2022 AKT\u0130F"] })] })] })] }, idx))) })] })), _jsxs("div", { className: "glass-panel p-6 rounded-3xl border border-armoyu-card-border bg-armoyu-card-bg", children: [_jsx("h3", { className: "font-extrabold text-armoyu-text mb-5 text-lg", children: "G\u00FCndemdeki Etiketler" }), _jsxs("div", { className: "space-y-4", children: [trendingTags.map((tagObj, idx) => (_jsxs("div", { className: `flex justify-between items-center cursor-pointer group p-2 rounded-xl transition-all ${selectedTag === tagObj.name ? 'bg-blue-500/10' : 'hover:bg-black/5 dark:hover:bg-white/5'}`, onClick: () => { setSelectedTag(tagObj.name === selectedTag ? null : tagObj.name); setVisibleCount(10); }, children: [_jsxs("div", { children: [_jsx("span", { className: `block text-sm font-bold transition-colors ${selectedTag === tagObj.name ? 'text-blue-500' : 'text-armoyu-text-muted group-hover:text-blue-500'}`, children: tagObj.name }), _jsxs("span", { className: "block text-[11px] text-armoyu-text-muted opacity-70 mt-0.5", children: [tagObj.count, " G\u00F6nderi"] })] }), _jsx("button", { className: `text-xs border rounded-full w-7 h-7 flex items-center justify-center transition-colors ${selectedTag === tagObj.name ? 'bg-blue-500 border-blue-500 text-white' : 'bg-black/5 dark:bg-white/5 border-black/5 dark:border-transparent text-armoyu-text-muted group-hover:text-armoyu-text'}`, children: selectedTag === tagObj.name ? (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "20 6 9 17 4 12" }) })) : (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: [_jsx("circle", { cx: "12", cy: "12", r: "1" }), _jsx("circle", { cx: "19", cy: "12", r: "1" }), _jsx("circle", { cx: "5", cy: "12", r: "1" })] })) })] }, idx))), _jsx("button", { className: "w-full mt-2 pt-4 border-t border-armoyu-card-border text-blue-500 hover:text-blue-600 dark:hover:text-blue-400 text-sm font-bold flex justify-center transition-colors", children: "T\u00FCm\u00FCn\u00FC G\u00F6r" })] })] }), _jsxs("div", { className: "glass-panel p-6 rounded-3xl border border-armoyu-card-border bg-armoyu-card-bg", children: [_jsxs("div", { className: "flex items-center justify-between mb-5", children: [_jsx("h3", { className: "font-extrabold text-armoyu-text text-lg", children: "Pop\u00FCler Gruplar" }), _jsx(Link, { href: "/gruplar", className: "text-xs font-bold text-blue-500 hover:underline", children: "T\u00FCm\u00FC" })] }), _jsxs("div", { className: "space-y-4", children: [groupList.slice(0, 4).map((group, idx) => (_jsxs(Link, { href: `/gruplar/${group.name.toLowerCase().replace(/\s+/g, '-')}`, className: "flex items-center gap-3 group cursor-pointer p-1 rounded-xl hover:bg-black/5 dark:hover:bg-white/5 transition-colors", children: [_jsxs("div", { className: "relative", children: [_jsx("img", { src: group.logo, alt: group.name, className: "w-10 h-10 rounded-xl object-cover border border-black/5 shadow-sm" }), group.recruitment === 'Açık' && (_jsx("div", { className: "absolute -bottom-1 -right-1 w-3 h-3 bg-emerald-500 rounded-full border-2 border-armoyu-card-bg shadow-sm", title: "Al\u0131mlar A\u00E7\u0131k" }))] }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("h4", { className: "text-sm font-bold text-armoyu-text truncate group-hover:text-blue-500 transition-colors uppercase tracking-tight", children: group.name }), _jsxs("p", { className: "text-[10px] text-armoyu-text-muted truncate opacity-80", children: [group.category, " \u2022 ", group.recruitment === 'Açık' ? 'Katıl' : 'Kapalı'] })] })] }, idx))), _jsx("button", { className: "w-full py-3 bg-black/5 dark:bg-white/5 border border-black/5 dark:border-white/5 hover:border-blue-500/30 hover:bg-blue-500/5 text-armoyu-text text-xs font-bold rounded-xl transition-all active:scale-[0.98]", children: "Yeni Grup Olu\u015Ftur" })] })] })] }), _jsx(CloudStorageModal, { isOpen: isCloudModalOpen, onClose: () => setIsCloudModalOpen(false), onSelectMedia: (url, type) => {
247
- setSelectedMedia(prev => [...prev, { url, type }]);
248
- setIsCloudModalOpen(false);
249
- } }), isBioModalOpen && (_jsxs("div", { className: "fixed inset-0 z-[200] flex items-center justify-center p-6", children: [_jsx("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-md", onClick: () => setIsBioModalOpen(false) }), _jsxs("div", { className: "bg-armoyu-card-bg border border-armoyu-card-border rounded-[40px] w-full max-w-lg relative z-10 shadow-2xl animate-in zoom-in-95 duration-300 overflow-hidden", children: [_jsxs("div", { className: "p-8 border-b border-armoyu-card-border flex items-center justify-between bg-black/5", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "w-12 h-12 rounded-2xl bg-blue-500/10 flex items-center justify-center text-blue-500 text-2xl", children: "\u270D\uFE0F" }), _jsxs("div", { children: [_jsx("h3", { className: "text-xl font-black text-armoyu-text uppercase tracking-tight italic", children: "Hakk\u0131nda Yaz\u0131s\u0131 Yaz" }), _jsx("p", { className: "text-xs font-medium text-armoyu-text-muted", children: "Profilinde kendini ifade et." })] })] }), _jsx("button", { onClick: () => setIsBioModalOpen(false), className: "p-2 text-armoyu-text-muted hover:text-armoyu-text bg-black/10 rounded-xl transition-all", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), _jsxs("div", { className: "p-8 space-y-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-[10px] font-black text-armoyu-text-muted uppercase tracking-widest ml-4", children: "SEN\u0130 TANIYALIM" }), _jsx("textarea", { className: "w-full bg-black/10 border border-armoyu-card-border rounded-3xl px-6 py-5 text-sm font-bold text-armoyu-text focus:outline-none focus:border-blue-500 transition-all min-h-[150px] resize-none", placeholder: "\u00D6rne\u011Fin: Merhaba! Ben bir ARMOYU \u00FCyesiyim ve oyun geli\u015Ftirmeyi seviyorum...", value: tempBio, onChange: (e) => setTempBio(e.target.value), autoFocus: true })] }), _jsx("button", { onClick: handleBioSave, className: "w-full py-5 bg-blue-600 hover:bg-blue-500 text-white font-black rounded-[20px] text-xs uppercase tracking-widest shadow-xl shadow-blue-500/20 active:scale-95 transition-all flex items-center justify-center gap-2 italic", children: "B\u0130YOGRAF\u0130M\u0130 KAYDET" })] })] })] }))] }));
250
- }
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useState, useEffect, useRef, useMemo } from 'react';
3
+ import { useSearchParams, useRouter } from 'next/navigation';
4
+ import { useAuth } from '../../../context/AuthContext';
5
+ import { useSocket } from '../../../context/SocketContext';
6
+ import { PostCard } from './PostCard';
7
+ import { Stories } from './Stories';
8
+ import { SidebarLeft } from './SidebarLeft';
9
+ import { CloudStorageModal } from '../profile/CloudStorageModal';
10
+ import Link from 'next/link';
11
+ import { postList, groupList } from '../../../lib/constants/seedData';
12
+ import { Post } from '@armoyu/core';
13
+ import { CheckCircle2 } from 'lucide-react';
14
+ export function Dashboard() {
15
+ const { user } = useAuth();
16
+ const { on } = useSocket();
17
+ const searchParams = useSearchParams();
18
+ const router = useRouter();
19
+ const focusedPostId = searchParams.get('post');
20
+ const [isCloudModalOpen, setIsCloudModalOpen] = useState(false);
21
+ const [isBioModalOpen, setIsBioModalOpen] = useState(false);
22
+ const [tempBio, setTempBio] = useState(user?.bio || '');
23
+ const [selectedMedia, setSelectedMedia] = useState([]);
24
+ const [selectedTag, setSelectedTag] = useState(null);
25
+ const [visibleCount, setVisibleCount] = useState(10);
26
+ const [isLoadingMore, setIsLoadingMore] = useState(false);
27
+ const { updateUser } = useAuth();
28
+ const [posts, setPosts] = useState(postList);
29
+ const [newPostsBuffer, setNewPostsBuffer] = useState([]);
30
+ const [isAtTop, setIsAtTop] = useState(true);
31
+ const [postContent, setPostContent] = useState('');
32
+ const [isPosting, setIsPosting] = useState(false);
33
+ const textareaRef = useRef(null);
34
+ const handleBioSave = () => {
35
+ if (user) {
36
+ updateUser({
37
+ ...user,
38
+ bio: tempBio
39
+ });
40
+ setIsBioModalOpen(false);
41
+ }
42
+ };
43
+ // Gündemdeki Etiketleri Dinamik Hesapla
44
+ const trendingTags = useMemo(() => {
45
+ const counts = {};
46
+ posts.forEach(post => {
47
+ post.hashtags?.forEach(tag => {
48
+ counts[tag] = (counts[tag] || 0) + 1;
49
+ });
50
+ });
51
+ return Object.entries(counts)
52
+ .map(([name, count]) => ({ name, count }))
53
+ .sort((a, b) => b.count - a.count)
54
+ .slice(0, 5);
55
+ }, [posts]);
56
+ // Filtremele ve Pagination Mantığı
57
+ const allFilteredPosts = useMemo(() => {
58
+ // 1. Post ID filtresi (En yüksek öncelik)
59
+ if (focusedPostId) {
60
+ return posts.filter(p => p.id === focusedPostId);
61
+ }
62
+ // 2. Tag filtresi
63
+ if (selectedTag) {
64
+ return posts.filter(post => post.hashtags?.includes(selectedTag.replace('#', '')));
65
+ }
66
+ return posts;
67
+ }, [posts, focusedPostId, selectedTag]);
68
+ const visiblePosts = allFilteredPosts.slice(0, visibleCount);
69
+ // Auto-resize logic for textarea
70
+ useEffect(() => {
71
+ if (textareaRef.current) {
72
+ textareaRef.current.style.height = 'inherit';
73
+ textareaRef.current.style.height = `${textareaRef.current.scrollHeight}px`;
74
+ }
75
+ }, [postContent]);
76
+ useEffect(() => {
77
+ const handleScroll = () => {
78
+ setIsAtTop(window.scrollY < 150);
79
+ };
80
+ window.addEventListener('scroll', handleScroll);
81
+ return () => window.removeEventListener('scroll', handleScroll);
82
+ }, []);
83
+ // Socket Listener for New Posts
84
+ useEffect(() => {
85
+ console.log('[Dashboard] Setting up socket listener for "post" event');
86
+ const offPost = on('post', (data) => {
87
+ console.log('[Dashboard] New socket post received!', data);
88
+ const newPost = Post.fromJSON(data);
89
+ setPosts(currentPosts => {
90
+ // If this is a post from the CURRENT USER, find the pending version and replace it
91
+ if (newPost.author?.username === user?.username) {
92
+ // Check if there is a pending post (we look for matches in content and media count as a heuristic)
93
+ const pendingIdx = currentPosts.findIndex(p => p.isPending && p.content === newPost.content);
94
+ if (pendingIdx !== -1) {
95
+ const updated = [...currentPosts];
96
+ updated[pendingIdx] = newPost; // Replace pending with confirmed
97
+ return updated;
98
+ }
99
+ }
100
+ // Standard duplicate check
101
+ if (currentPosts.some(p => p.id === newPost.id))
102
+ return currentPosts;
103
+ if (window.scrollY < 150) {
104
+ return [newPost, ...currentPosts];
105
+ }
106
+ else {
107
+ setNewPostsBuffer(prev => {
108
+ if (prev.some(p => p.id === newPost.id))
109
+ return prev;
110
+ return [newPost, ...prev];
111
+ });
112
+ return currentPosts;
113
+ }
114
+ });
115
+ });
116
+ const offLike = on('post_like', (data) => {
117
+ const { postId, newCount } = data;
118
+ setPosts(currentPosts => currentPosts.map(p => {
119
+ if (p.id === postId) {
120
+ return {
121
+ ...p,
122
+ stats: { ...p.stats, likes: newCount }
123
+ };
124
+ }
125
+ return p;
126
+ }));
127
+ });
128
+ const offRepostCount = on('post_repost_count', (data) => {
129
+ const { postId } = data;
130
+ setPosts(currentPosts => currentPosts.map(p => {
131
+ if (p.id === postId) {
132
+ return {
133
+ ...p,
134
+ stats: { ...p.stats, reposts: (p.stats.reposts || 0) + 1 }
135
+ };
136
+ }
137
+ return p;
138
+ }));
139
+ });
140
+ return () => {
141
+ offPost();
142
+ offLike();
143
+ offRepostCount();
144
+ };
145
+ }, [on]);
146
+ const mergeNewPosts = () => {
147
+ setPosts(prev => [...newPostsBuffer, ...prev]);
148
+ setNewPostsBuffer([]);
149
+ window.scrollTo({ top: 0, behavior: 'smooth' });
150
+ };
151
+ const { emit } = useSocket();
152
+ const handleCreatePost = () => {
153
+ try {
154
+ if ((!postContent.trim() && selectedMedia.length === 0) || isPosting || !user) {
155
+ return;
156
+ }
157
+ // 1. Create optimistic local post
158
+ const tempId = 'p-temp-' + Date.now();
159
+ const optimisticPost = new Post({
160
+ id: tempId,
161
+ author: user,
162
+ content: postContent,
163
+ media: selectedMedia,
164
+ createdAt: 'Gönderiliyor...',
165
+ stats: { likes: 0, comments: 0, shares: 0, reposts: 0 },
166
+ hashtags: postContent.match(/#\w+/g)?.map(t => t.replace('#', '')) || [],
167
+ isPending: true
168
+ });
169
+ // 2. Clear inputs & Add to state immediately
170
+ const savedContent = postContent;
171
+ const savedMedia = [...selectedMedia];
172
+ setPosts(prev => [optimisticPost, ...prev]);
173
+ setPostContent('');
174
+ setSelectedMedia([]);
175
+ console.log('[Dashboard] Optimistic post added, inputs cleared.');
176
+ // 3. Prepare wire data
177
+ const wireData = {
178
+ id: 'p-' + Date.now(), // Real ID candidate
179
+ author: {
180
+ id: user.id,
181
+ username: user.username,
182
+ displayName: user.displayName,
183
+ avatar: user.avatar,
184
+ role: user.role,
185
+ verified: user.verified,
186
+ level: user.level
187
+ },
188
+ content: savedContent,
189
+ media: savedMedia,
190
+ createdAt: 'Şimdi',
191
+ stats: { likes: 0, comments: 0, shares: 0, reposts: 0 },
192
+ hashtags: savedContent.match(/#\w+/g)?.map(t => t.replace('#', '')) || []
193
+ };
194
+ // 4. Emit to socket server
195
+ emit('post', wireData);
196
+ }
197
+ catch (error) {
198
+ console.error('[Dashboard] Error in handleCreatePost:', error);
199
+ }
200
+ };
201
+ // Sonsuz Kaydırma Trigger (Intersection Observer)
202
+ const loaderRef = useRef(null);
203
+ useEffect(() => {
204
+ const observer = new IntersectionObserver((entries) => {
205
+ if (entries[0].isIntersecting && !isLoadingMore && visibleCount < allFilteredPosts.length) {
206
+ setIsLoadingMore(true);
207
+ setTimeout(() => {
208
+ setVisibleCount(prev => prev + 10);
209
+ setIsLoadingMore(false);
210
+ }, 800);
211
+ }
212
+ }, { threshold: 0.1 });
213
+ if (loaderRef.current) {
214
+ observer.observe(loaderRef.current);
215
+ }
216
+ return () => observer.disconnect();
217
+ }, [isLoadingMore, visibleCount, allFilteredPosts.length]);
218
+ return (_jsxs("div", { className: "w-full flex-1 flex gap-6 pb-20 animate-in fade-in slide-in-from-bottom-8 duration-700 items-start", children: [_jsx(SidebarLeft, {}), _jsxs("div", { className: "flex-1 flex flex-col pt-2", children: [_jsx(Stories, {}), _jsxs("div", { className: "glass-panel p-4 md:p-5 rounded-3xl border border-armoyu-card-border bg-armoyu-card-bg shadow-sm mb-8", children: [_jsxs("div", { className: "flex gap-4 items-start", children: [_jsx("img", { src: user?.avatar || "https://api.dicebear.com/7.x/avataaars/svg?seed=Armoyu", alt: "Avatar", className: "w-12 h-12 rounded-full border border-black/10 dark:border-white/10 shadow-sm mt-1" }), _jsxs("div", { className: "flex-1 flex flex-col gap-3", children: [_jsx("textarea", { ref: textareaRef, value: postContent, onChange: (e) => setPostContent(e.target.value), onKeyDown: (e) => {
219
+ if (e.key === 'Enter' && !e.shiftKey) {
220
+ e.preventDefault();
221
+ handleCreatePost();
222
+ }
223
+ }, placeholder: "Neler yap\u0131yorsun, d\u00FC\u015F\u00FCncelerini payla\u015F...", className: "w-full bg-black/5 dark:bg-white/5 border border-black/10 dark:border-white/10 hover:border-black/20 dark:hover:border-white/20 rounded-2xl px-5 py-3 text-sm text-armoyu-text placeholder-armoyu-text-muted focus:outline-none focus:border-blue-500 focus:ring-1 focus:ring-blue-500 transition-all font-medium resize-none min-h-[44px] max-h-[300px] overflow-y-auto" }), selectedMedia.length > 0 && (_jsx("div", { className: "flex gap-2.5 overflow-x-auto pb-2 scrollbar-hide animate-in fade-in slide-in-from-left-4 duration-300", children: selectedMedia.map((media, idx) => (_jsxs("div", { className: "relative group shrink-0", children: [media.type === 'video' ? (_jsxs("div", { className: "w-24 h-24 rounded-2xl bg-black/20 flex items-center justify-center border border-white/10 overflow-hidden", children: [_jsx("video", { src: media.url, className: "w-full h-full object-cover opacity-60" }), _jsx("div", { className: "absolute inset-0 flex items-center justify-center", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "white", children: _jsx("polygon", { points: "5 3 19 12 5 21 5 3" }) }) })] })) : (_jsx("img", { src: media.url, alt: "Preview", className: "w-24 h-24 rounded-2xl object-cover border border-white/10 shadow-md group-hover:scale-105 transition-transform" })), _jsx("button", { onClick: () => setSelectedMedia(prev => prev.filter((_, i) => i !== idx)), className: "absolute -top-1.5 -right-1.5 w-6 h-6 bg-red-500 text-white rounded-full flex items-center justify-center shadow-lg hover:bg-red-600 transition-colors z-10", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }, idx))) }))] })] }), _jsxs("div", { className: "flex justify-between items-center mt-3 pl-16", children: [_jsxs("div", { className: "flex gap-2", children: [_jsx("button", { onClick: () => setIsCloudModalOpen(true), className: "flex items-center justify-center p-2.5 text-blue-500 hover:bg-blue-500/10 rounded-xl transition-colors shrink-0", title: "Cloud Medya Galerisini A\u00E7", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "currentColor", stroke: "currentColor", strokeWidth: "1", strokeLinecap: "round", strokeLinejoin: "round", className: "text-blue-500", children: _jsx("path", { d: "M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z" }) }) }), _jsx("button", { className: "p-2 text-armoyu-text-muted hover:text-blue-500 hover:bg-blue-500/10 rounded-full transition-colors", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("rect", { x: "3", y: "3", width: "18", height: "18", rx: "2", ry: "2" }), _jsx("circle", { cx: "8.5", cy: "8.5", r: "1.5" }), _jsx("polyline", { points: "21 15 16 10 5 21" })] }) }), _jsx("button", { className: "p-2 text-armoyu-text-muted hover:text-emerald-500 hover:bg-emerald-500/10 rounded-full transition-colors", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("circle", { cx: "12", cy: "12", r: "10" }), _jsx("path", { d: "M8 14s1.5 2 4 2 4-2 4-2" }), _jsx("line", { x1: "9", y1: "9", x2: "9.01", y2: "9" }), _jsx("line", { x1: "15", y1: "9", x2: "15.01", y2: "9" })] }) })] }), _jsx("button", { onClick: handleCreatePost, disabled: isPosting || (!postContent.trim() && selectedMedia.length === 0), className: "px-6 py-2 bg-gradient-to-r from-blue-600 to-blue-500 hover:from-blue-500 hover:to-blue-400 disabled:opacity-50 disabled:cursor-not-allowed text-white text-sm font-bold rounded-xl shadow-md transition-all active:scale-95", children: isPosting ? 'Gidiyor...' : 'Gönder' })] })] }), focusedPostId && (_jsxs("div", { className: "flex items-center justify-between bg-blue-600/10 border border-blue-600/20 p-5 rounded-3xl mb-6 animate-in fade-in zoom-in duration-500", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "w-10 h-10 rounded-full bg-blue-600/20 flex items-center justify-center text-blue-600", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M15 3h6v6" }), _jsx("path", { d: "M10 14 21 3" }), _jsx("path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6" })] }) }), _jsxs("div", { children: [_jsx("h4", { className: "text-sm font-black text-armoyu-text uppercase tracking-tight", children: "Tekil G\u00F6nderi Modu" }), _jsx("p", { className: "text-xs text-armoyu-text-muted font-bold", children: "\u015Eu an sadece bu bildirime ait payla\u015F\u0131m\u0131 g\u00F6r\u00FCyorsunuz." })] })] }), _jsx("button", { onClick: () => router.push('/'), className: "px-5 py-2 bg-blue-600 text-white text-xs font-black rounded-xl hover:bg-blue-500 shadow-md transition-all active:scale-95 uppercase tracking-widest", children: "T\u00FCm Ak\u0131\u015Fa D\u00F6n" })] })), newPostsBuffer.length > 0 && (_jsx("div", { className: "fixed bottom-12 left-1/2 -translate-x-1/2 z-[60] flex justify-center pointer-events-none", children: _jsxs("button", { onClick: mergeNewPosts, className: "pointer-events-auto flex items-center gap-3 px-8 py-3 bg-blue-600/95 backdrop-blur-xl text-white text-sm font-black rounded-full shadow-[0_15px_35px_rgba(37,99,235,0.45)] border border-white/30 hover:bg-blue-500 hover:scale-105 hover:-translate-y-1 transition-all animate-in slide-in-from-bottom-12 fade-in duration-500", children: [_jsx("div", { className: "flex -space-x-2", children: newPostsBuffer.slice(0, 3).map((p, i) => (_jsx("img", { src: p.author?.avatar, className: "w-7 h-7 rounded-full border-2 border-white shadow-sm bg-armoyu-card-bg" }, i))) }), _jsxs("span", { className: "whitespace-nowrap", children: [newPostsBuffer.length, " Yeni Payla\u015F\u0131m\u0131 G\u00F6r\u00FCnt\u00FCle"] }), _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "m18 15-6-6-6 6" }) })] }) })), _jsxs("div", { className: "space-y-6", children: [selectedTag && (_jsxs("div", { className: "flex items-center justify-between bg-blue-500/10 border border-blue-500/20 p-4 rounded-2xl animate-in fade-in slide-in-from-left-4 duration-300", children: [_jsxs("div", { className: "flex items-center gap-2", children: [_jsx("span", { className: "text-sm font-bold text-armoyu-text-muted", children: "Filtrelenen Etiket:" }), _jsx("span", { className: "text-sm font-black text-blue-500", children: selectedTag })] }), _jsx("button", { onClick: () => { setSelectedTag(null); setVisibleCount(10); }, className: "text-xs font-bold text-red-500 hover:underline", children: "Filtreyi Temizle" })] })), visiblePosts.length > 0 ? (visiblePosts.map(post => (_jsx(PostCard, { ...post, onTagClick: (tag) => { setSelectedTag(tag); setVisibleCount(10); } }, post.id)))) : (_jsx("div", { className: "text-center py-20 bg-black/5 dark:bg-white/5 rounded-3xl border border-dashed border-armoyu-card-border", children: _jsx("p", { className: "text-armoyu-text-muted font-bold", children: "Bu etikete ait hen\u00FCz bir payla\u015F\u0131m yok." }) })), _jsx("div", { ref: loaderRef, className: "py-10 flex flex-col items-center justify-center gap-3", children: visibleCount < allFilteredPosts.length ? (_jsxs(_Fragment, { children: [_jsx("div", { className: "w-8 h-8 border-4 border-blue-500/20 border-t-blue-500 rounded-full animate-spin" }), _jsx("p", { className: "text-xs font-bold text-armoyu-text-muted animate-pulse italic", children: "Daha fazla i\u00E7erik y\u00FCkleniyor..." })] })) : (_jsxs("div", { className: "flex items-center gap-4 opacity-50", children: [_jsx("div", { className: "h-px w-20 bg-armoyu-card-border" }), _jsx("span", { className: "text-[10px] uppercase font-black tracking-widest text-armoyu-text-muted", children: "T\u00FCm ak\u0131\u015F g\u00F6r\u00FCnt\u00FClendi" }), _jsx("div", { className: "h-px w-20 bg-armoyu-card-border" })] })) })] })] }), _jsxs("div", { className: "hidden lg:flex w-[320px] flex-col gap-6", children: [_jsxs("div", { className: "glass-panel p-6 rounded-3xl border border-armoyu-card-border bg-armoyu-card-bg group overflow-hidden relative", children: [_jsx("div", { className: "absolute -top-10 -right-10 w-32 h-32 bg-blue-500/5 rounded-full blur-3xl group-hover:bg-blue-500/10 transition-all duration-700" }), _jsxs("div", { className: "relative z-10", children: [_jsxs("h3", { className: "font-extrabold text-armoyu-text text-xl tracking-tight mb-6", children: ["Ho\u015F Geldin, ", _jsx("span", { className: "text-blue-500", children: user?.displayName?.split(' ')[0] })] }), (() => {
224
+ const steps = [
225
+ { id: 'avatar', label: 'Profil Fotoğrafı Ekle', completed: !!user?.avatar && !user.avatar.includes('seed=Armoyu'), icon: '🖼️' },
226
+ { id: 'bio', label: 'Hakkında Yazısı Yaz', completed: !!user?.bio && user.bio.length > 5, icon: '✍️' },
227
+ { id: 'verified', label: 'E-posta Onayla', completed: !!user?.verified, icon: '📧' },
228
+ { id: 'groups', label: 'Bir Gruba Katıl', completed: (user?.groups?.length || 0) > 0, icon: '🛡️' }
229
+ ];
230
+ const totalPercentage = steps.reduce((acc, step) => acc + (step.completed ? 25 : 0), 0);
231
+ const nextStep = steps.find(s => !s.completed);
232
+ if (totalPercentage === 100) {
233
+ return (_jsxs("div", { className: "flex items-center gap-2 animate-in fade-in duration-700", children: [_jsx(CheckCircle2, { size: 16, className: "text-emerald-500" }), _jsx("span", { className: "text-[10px] font-black text-emerald-500 uppercase tracking-widest", children: "T\u00FCm g\u00F6revler tamamland\u0131" })] }));
234
+ }
235
+ return (_jsxs("div", { className: "animate-in fade-in slide-in-from-top-4 duration-500", children: [_jsxs("div", { className: "flex items-center justify-between mb-4", children: [_jsx("span", { className: "text-[10px] font-black text-armoyu-text-muted uppercase tracking-widest", children: "Aktif G\u00F6revin" }), _jsxs("span", { className: "text-[10px] font-black text-blue-500 uppercase tracking-widest bg-blue-500/10 px-2 py-0.5 rounded", children: ["%", totalPercentage, " Tamamland\u0131"] })] }), _jsxs("button", { onClick: () => {
236
+ if (nextStep?.id === 'bio') {
237
+ setIsBioModalOpen(true);
238
+ }
239
+ else if (nextStep?.id === 'groups') {
240
+ router.push('/gruplar');
241
+ }
242
+ else {
243
+ router.push('/ayarlar/profil');
244
+ }
245
+ }, className: "w-full flex items-center gap-4 p-4 bg-black/20 hover:bg-blue-600 border border-white/5 rounded-2xl group/task transition-all active:scale-95 shadow-xl text-left", children: [_jsx("div", { className: "w-12 h-12 rounded-xl bg-white/5 flex items-center justify-center text-2xl group-hover/task:bg-white/20 transition-colors", children: nextStep?.icon }), _jsxs("div", { className: "flex-1", children: [_jsx("h4", { className: "text-sm font-black text-armoyu-text group-hover/task:text-white uppercase tracking-tight", children: nextStep?.label }), _jsx("p", { className: "text-[10px] font-bold text-armoyu-text-muted group-hover/task:text-white/80 uppercase tracking-widest mt-1 italic", children: "Hemen Tamamla \u2192" })] })] })] }));
246
+ })()] })] }), (user?.groups?.length || 0) > 0 && (_jsxs("div", { className: "glass-panel p-6 rounded-3xl border border-armoyu-card-border bg-armoyu-card-bg transition-all animate-in fade-in zoom-in duration-500", children: [_jsxs("div", { className: "flex items-center justify-between mb-5", children: [_jsx("h3", { className: "font-extrabold text-armoyu-text text-lg", children: "Gruplar\u0131m" }), _jsxs("span", { className: "bg-blue-500/10 text-blue-500 text-[10px] font-black px-2 py-0.5 rounded-md uppercase", children: [(user?.groups?.length || 0), " Grup"] })] }), _jsx("div", { className: "space-y-4", children: user?.groups?.map((group, idx) => (_jsxs(Link, { href: `/gruplar/${group.name.toLowerCase().replace(/\s+/g, '-')}`, className: "flex items-center gap-3 group cursor-pointer p-1 rounded-xl hover:bg-black/5 dark:hover:bg-white/5 transition-colors", children: [_jsx("img", { src: group.logo, alt: group.name, className: "w-10 h-10 rounded-xl object-cover border border-black/5 shadow-sm group-hover:scale-105 transition-transform" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("h4", { className: "text-sm font-bold text-armoyu-text truncate group-hover:text-blue-500 transition-colors uppercase tracking-tight", children: group.name }), _jsxs("div", { className: "flex items-center gap-1.5 mt-0.5", children: [_jsx("span", { className: "w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse" }), _jsxs("span", { className: "text-[10px] text-armoyu-text-muted truncate opacity-80 uppercase font-bold tracking-widest", children: [group.shortName, " \u2022 AKT\u0130F"] })] })] })] }, idx))) })] })), _jsxs("div", { className: "glass-panel p-6 rounded-3xl border border-armoyu-card-border bg-armoyu-card-bg", children: [_jsx("h3", { className: "font-extrabold text-armoyu-text mb-5 text-lg", children: "G\u00FCndemdeki Etiketler" }), _jsxs("div", { className: "space-y-4", children: [trendingTags.map((tagObj, idx) => (_jsxs("div", { className: `flex justify-between items-center cursor-pointer group p-2 rounded-xl transition-all ${selectedTag === tagObj.name ? 'bg-blue-500/10' : 'hover:bg-black/5 dark:hover:bg-white/5'}`, onClick: () => { setSelectedTag(tagObj.name === selectedTag ? null : tagObj.name); setVisibleCount(10); }, children: [_jsxs("div", { children: [_jsx("span", { className: `block text-sm font-bold transition-colors ${selectedTag === tagObj.name ? 'text-blue-500' : 'text-armoyu-text-muted group-hover:text-blue-500'}`, children: tagObj.name }), _jsxs("span", { className: "block text-[11px] text-armoyu-text-muted opacity-70 mt-0.5", children: [tagObj.count, " G\u00F6nderi"] })] }), _jsx("button", { className: `text-xs border rounded-full w-7 h-7 flex items-center justify-center transition-colors ${selectedTag === tagObj.name ? 'bg-blue-500 border-blue-500 text-white' : 'bg-black/5 dark:bg-white/5 border-black/5 dark:border-transparent text-armoyu-text-muted group-hover:text-armoyu-text'}`, children: selectedTag === tagObj.name ? (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("polyline", { points: "20 6 9 17 4 12" }) })) : (_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "14", height: "14", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", children: [_jsx("circle", { cx: "12", cy: "12", r: "1" }), _jsx("circle", { cx: "19", cy: "12", r: "1" }), _jsx("circle", { cx: "5", cy: "12", r: "1" })] })) })] }, idx))), _jsx("button", { className: "w-full mt-2 pt-4 border-t border-armoyu-card-border text-blue-500 hover:text-blue-600 dark:hover:text-blue-400 text-sm font-bold flex justify-center transition-colors", children: "T\u00FCm\u00FCn\u00FC G\u00F6r" })] })] }), _jsxs("div", { className: "glass-panel p-6 rounded-3xl border border-armoyu-card-border bg-armoyu-card-bg", children: [_jsxs("div", { className: "flex items-center justify-between mb-5", children: [_jsx("h3", { className: "font-extrabold text-armoyu-text text-lg", children: "Pop\u00FCler Gruplar" }), _jsx(Link, { href: "/gruplar", className: "text-xs font-bold text-blue-500 hover:underline", children: "T\u00FCm\u00FC" })] }), _jsxs("div", { className: "space-y-4", children: [groupList.slice(0, 4).map((group, idx) => (_jsxs(Link, { href: `/gruplar/${group.name.toLowerCase().replace(/\s+/g, '-')}`, className: "flex items-center gap-3 group cursor-pointer p-1 rounded-xl hover:bg-black/5 dark:hover:bg-white/5 transition-colors", children: [_jsxs("div", { className: "relative", children: [_jsx("img", { src: group.logo, alt: group.name, className: "w-10 h-10 rounded-xl object-cover border border-black/5 shadow-sm" }), group.recruitment === 'Açık' && (_jsx("div", { className: "absolute -bottom-1 -right-1 w-3 h-3 bg-emerald-500 rounded-full border-2 border-armoyu-card-bg shadow-sm", title: "Al\u0131mlar A\u00E7\u0131k" }))] }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("h4", { className: "text-sm font-bold text-armoyu-text truncate group-hover:text-blue-500 transition-colors uppercase tracking-tight", children: group.name }), _jsxs("p", { className: "text-[10px] text-armoyu-text-muted truncate opacity-80", children: [group.category, " \u2022 ", group.recruitment === 'Açık' ? 'Katıl' : 'Kapalı'] })] })] }, idx))), _jsx("button", { className: "w-full py-3 bg-black/5 dark:bg-white/5 border border-black/5 dark:border-white/5 hover:border-blue-500/30 hover:bg-blue-500/5 text-armoyu-text text-xs font-bold rounded-xl transition-all active:scale-[0.98]", children: "Yeni Grup Olu\u015Ftur" })] })] })] }), _jsx(CloudStorageModal, { isOpen: isCloudModalOpen, onClose: () => setIsCloudModalOpen(false), onSelectMedia: (url, type) => {
247
+ setSelectedMedia(prev => [...prev, { url, type }]);
248
+ setIsCloudModalOpen(false);
249
+ } }), isBioModalOpen && (_jsxs("div", { className: "fixed inset-0 z-[200] flex items-center justify-center p-6", children: [_jsx("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-md", onClick: () => setIsBioModalOpen(false) }), _jsxs("div", { className: "bg-armoyu-card-bg border border-armoyu-card-border rounded-[40px] w-full max-w-lg relative z-10 shadow-2xl animate-in zoom-in-95 duration-300 overflow-hidden", children: [_jsxs("div", { className: "p-8 border-b border-armoyu-card-border flex items-center justify-between bg-black/5", children: [_jsxs("div", { className: "flex items-center gap-4", children: [_jsx("div", { className: "w-12 h-12 rounded-2xl bg-blue-500/10 flex items-center justify-center text-blue-500 text-2xl", children: "\u270D\uFE0F" }), _jsxs("div", { children: [_jsx("h3", { className: "text-xl font-black text-armoyu-text uppercase tracking-tight italic", children: "Hakk\u0131nda Yaz\u0131s\u0131 Yaz" }), _jsx("p", { className: "text-xs font-medium text-armoyu-text-muted", children: "Profilinde kendini ifade et." })] })] }), _jsx("button", { onClick: () => setIsBioModalOpen(false), className: "p-2 text-armoyu-text-muted hover:text-armoyu-text bg-black/10 rounded-xl transition-all", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "18", y1: "6", x2: "6", y2: "18" }), _jsx("line", { x1: "6", y1: "6", x2: "18", y2: "18" })] }) })] }), _jsxs("div", { className: "p-8 space-y-6", children: [_jsxs("div", { className: "space-y-2", children: [_jsx("label", { className: "text-[10px] font-black text-armoyu-text-muted uppercase tracking-widest ml-4", children: "SEN\u0130 TANIYALIM" }), _jsx("textarea", { className: "w-full bg-black/10 border border-armoyu-card-border rounded-3xl px-6 py-5 text-sm font-bold text-armoyu-text focus:outline-none focus:border-blue-500 transition-all min-h-[150px] resize-none", placeholder: "\u00D6rne\u011Fin: Merhaba! Ben bir ARMOYU \u00FCyesiyim ve oyun geli\u015Ftirmeyi seviyorum...", value: tempBio, onChange: (e) => setTempBio(e.target.value), autoFocus: true })] }), _jsx("button", { onClick: handleBioSave, className: "w-full py-5 bg-blue-600 hover:bg-blue-500 text-white font-black rounded-[20px] text-xs uppercase tracking-widest shadow-xl shadow-blue-500/20 active:scale-95 transition-all flex items-center justify-center gap-2 italic", children: "B\u0130YOGRAF\u0130M\u0130 KAYDET" })] })] })] }))] }));
250
+ }
251
251
  //# sourceMappingURL=Dashboard.js.map