@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.
- package/dist/app/layout.d.ts.map +1 -1
- package/dist/app/layout.js +16 -13
- package/dist/app/layout.js.map +1 -1
- package/dist/components/Button.d.ts +7 -7
- package/dist/components/Button.js +15 -15
- package/dist/components/GenderStatsBar.d.ts +5 -5
- package/dist/components/GenderStatsBar.js +7 -7
- package/dist/components/RollingNumber.js +3 -3
- package/dist/components/RollingNumber.js.map +1 -1
- package/dist/components/Slider.d.ts +10 -10
- package/dist/components/Slider.js +35 -35
- package/dist/components/StatsGrid.d.ts +5 -5
- package/dist/components/StatsGrid.js +13 -13
- package/dist/components/ViewModeToggle.d.ts +7 -7
- package/dist/components/ViewModeToggle.js +9 -9
- package/dist/components/modules/auth/Dashboard.d.ts +1 -1
- package/dist/components/modules/auth/Dashboard.js +250 -250
- package/dist/components/modules/auth/MediaLightbox.d.ts +13 -13
- package/dist/components/modules/auth/MediaLightbox.js +46 -46
- package/dist/components/modules/auth/PostCard.d.ts +24 -24
- package/dist/components/modules/auth/PostCard.js +112 -112
- package/dist/components/modules/auth/PostInteractionsModal.d.ts +11 -11
- package/dist/components/modules/auth/PostInteractionsModal.js +12 -12
- package/dist/components/modules/auth/RepostModal.d.ts +21 -21
- package/dist/components/modules/auth/RepostModal.js +75 -75
- package/dist/components/modules/auth/SidebarLeft.d.ts +1 -1
- package/dist/components/modules/auth/SidebarLeft.js +40 -40
- package/dist/components/modules/auth/Stories.d.ts +1 -1
- package/dist/components/modules/auth/Stories.js +15 -15
- package/dist/components/modules/auth/StoryViewer.d.ts +9 -9
- package/dist/components/modules/auth/StoryViewer.js +47 -47
- package/dist/components/modules/chat/ChatContainer.d.ts +1 -1
- package/dist/components/modules/chat/ChatContainer.js +196 -196
- package/dist/components/modules/chat/ChatInput.d.ts +4 -4
- package/dist/components/modules/chat/ChatInput.js +30 -30
- package/dist/components/modules/chat/ChatList.d.ts +6 -6
- package/dist/components/modules/chat/ChatList.js +51 -51
- package/dist/components/modules/chat/ChatMessage.d.ts +11 -11
- package/dist/components/modules/chat/ChatMessage.js +6 -6
- package/dist/components/modules/chat/ChatNotes.d.ts +1 -1
- package/dist/components/modules/chat/ChatNotes.js +11 -11
- package/dist/components/modules/community/GroupHeader.d.ts +10 -10
- package/dist/components/modules/community/GroupHeader.js +17 -17
- package/dist/components/modules/community/GroupMenu.d.ts +9 -9
- package/dist/components/modules/community/GroupMenu.js +16 -16
- package/dist/components/modules/community/SchoolCard.d.ts +6 -6
- package/dist/components/modules/community/SchoolCard.js +7 -7
- package/dist/components/modules/community/SurveyCard.d.ts +6 -6
- package/dist/components/modules/community/SurveyCard.js +35 -35
- package/dist/components/modules/forum/ForumBoard.d.ts +16 -16
- package/dist/components/modules/forum/ForumBoard.js +6 -6
- package/dist/components/modules/forum/ForumPost.d.ts +13 -13
- package/dist/components/modules/forum/ForumPost.js +5 -5
- package/dist/components/modules/forum/NewTopicModal.d.ts +7 -7
- package/dist/components/modules/forum/NewTopicModal.js +26 -26
- package/dist/components/modules/forum/TopicItem.d.ts +15 -15
- package/dist/components/modules/forum/TopicItem.js +6 -6
- package/dist/components/modules/galleries/GalleryCard.d.ts +9 -9
- package/dist/components/modules/galleries/GalleryCard.js +5 -5
- package/dist/components/modules/giveaways/GiveawayCard.d.ts +9 -9
- package/dist/components/modules/giveaways/GiveawayCard.js +6 -6
- package/dist/components/modules/groups/ApplicationModal.d.ts +7 -7
- package/dist/components/modules/groups/ApplicationModal.js +27 -27
- package/dist/components/modules/groups/GroupCard.d.ts +12 -12
- package/dist/components/modules/groups/GroupCard.js +6 -6
- package/dist/components/modules/guest/Introduction.d.ts +1 -1
- package/dist/components/modules/guest/Introduction.js +13 -13
- package/dist/components/modules/magaza/BackToStore.d.ts +1 -1
- package/dist/components/modules/magaza/BackToStore.js +10 -10
- package/dist/components/modules/magaza/StoreHeader.d.ts +5 -5
- package/dist/components/modules/magaza/StoreHeader.js +8 -8
- package/dist/components/modules/news/NewsCard.d.ts +11 -11
- package/dist/components/modules/news/NewsCard.js +6 -6
- package/dist/components/modules/news/NewsComments.d.ts +1 -1
- package/dist/components/modules/news/NewsComments.js +52 -52
- package/dist/components/modules/profile/CloudStorageModal.d.ts +8 -8
- package/dist/components/modules/profile/CloudStorageModal.js +31 -31
- package/dist/components/modules/profile/EditProfileModal.d.ts +8 -8
- package/dist/components/modules/profile/EditProfileModal.js +27 -27
- package/dist/components/modules/profile/ProfileContent.d.ts +4 -4
- package/dist/components/modules/profile/ProfileContent.js +70 -70
- package/dist/components/modules/profile/ProfileHeader.d.ts +7 -7
- package/dist/components/modules/profile/ProfileHeader.js +19 -19
- package/dist/components/modules/profile/ProfileStats.js +1 -1
- package/dist/components/modules/profile/ProfileStats.js.map +1 -1
- package/dist/components/modules/profile/TeamSelectorModal.d.ts +10 -10
- package/dist/components/modules/profile/TeamSelectorModal.js +16 -16
- package/dist/components/modules/stations/StationCard.d.ts +2 -2
- package/dist/components/modules/stations/StationCard.js +25 -25
- package/dist/components/modules/stations/StationQRModal.d.ts +9 -9
- package/dist/components/modules/stations/StationQRModal.js +12 -12
- package/dist/components/shared/FloatingChatButton.d.ts +4 -4
- package/dist/components/shared/FloatingChatButton.js +20 -20
- package/dist/components/shared/Footer.d.ts +1 -1
- package/dist/components/shared/Footer.js +9 -9
- package/dist/components/shared/Header.d.ts +1 -1
- package/dist/components/shared/Header.js +97 -97
- package/dist/components/shared/LoginModal.d.ts +4 -4
- package/dist/components/shared/LoginModal.js +69 -69
- package/dist/components/shared/MainLayoutWrapper.d.ts +3 -3
- package/dist/components/shared/MainLayoutWrapper.js +7 -7
- package/dist/components/shared/PageWidth.d.ts +5 -5
- package/dist/components/shared/PageWidth.js +13 -13
- package/dist/context/AuthContext.d.ts +18 -18
- package/dist/context/AuthContext.js +74 -74
- package/dist/context/CartContext.d.ts +16 -16
- package/dist/context/CartContext.js +63 -63
- package/dist/context/ChatContext.d.ts +12 -12
- package/dist/context/ChatContext.js +17 -17
- package/dist/context/LayoutContext.d.ts +10 -10
- package/dist/context/LayoutContext.js +16 -16
- package/dist/context/SocketContext.d.ts +12 -12
- package/dist/context/SocketContext.js +30 -30
- package/dist/context/ThemeContext.d.ts +10 -10
- package/dist/context/ThemeContext.js +39 -39
- package/dist/index.d.ts +65 -65
- package/dist/index.js +80 -80
- package/dist/lib/constants/educationData.d.ts +7 -7
- package/dist/lib/constants/educationData.js +117 -117
- package/dist/lib/constants/punishmentData.d.ts +29 -29
- package/dist/lib/constants/punishmentData.js +183 -183
- package/dist/lib/constants/seedData.d.ts +164 -164
- package/dist/lib/constants/seedData.js +694 -694
- package/dist/lib/constants/stationData.d.ts +13 -13
- package/dist/lib/constants/stationData.js +166 -166
- package/dist/lib/constants/surveyData.d.ts +2 -2
- package/dist/lib/constants/surveyData.js +49 -49
- package/dist/lib/constants/teamData.d.ts +12 -12
- package/dist/lib/constants/teamData.js +65 -65
- package/dist/types/stats.d.ts +17 -17
- package/dist/types/stats.js +1 -1
- package/next.config.ts +13 -13
- package/package.json +45 -46
- package/postcss.config.js +6 -6
- package/src/app/layout.tsx +67 -64
- package/src/app/page.tsx +101 -101
- package/src/components/RollingNumber.tsx +3 -3
- package/src/components/modules/profile/ProfileStats.tsx +4 -4
- package/src/components/showcase/CommunityTab.tsx +22 -22
- package/src/components/showcase/CorporateTab.tsx +38 -38
- package/src/components/showcase/GeneralTab.tsx +41 -41
- package/src/components/showcase/MessagesTab.tsx +26 -26
- package/src/components/showcase/ProfileTab.tsx +20 -20
- package/src/components/showcase/ShopTab.tsx +24 -24
- package/src/components/showcase/SocialTab.tsx +28 -28
- package/src/globals.css +187 -187
- package/src/lib/utils/numberFormat.ts +16 -16
- package/src/lib/utils/odpUtils.ts +51 -51
- package/src/types/index.ts +1 -1
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
export interface PostMedia {
|
|
3
|
-
type: 'image' | 'video';
|
|
4
|
-
url: string;
|
|
5
|
-
}
|
|
6
|
-
interface MediaLightboxProps {
|
|
7
|
-
isOpen: boolean;
|
|
8
|
-
onClose: () => void;
|
|
9
|
-
media: PostMedia[];
|
|
10
|
-
initialIndex?: number;
|
|
11
|
-
}
|
|
12
|
-
export declare function MediaLightbox({ isOpen, onClose, media, initialIndex }: MediaLightboxProps): React.ReactPortal | null;
|
|
13
|
-
export {};
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface PostMedia {
|
|
3
|
+
type: 'image' | 'video';
|
|
4
|
+
url: string;
|
|
5
|
+
}
|
|
6
|
+
interface MediaLightboxProps {
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
onClose: () => void;
|
|
9
|
+
media: PostMedia[];
|
|
10
|
+
initialIndex?: number;
|
|
11
|
+
}
|
|
12
|
+
export declare function MediaLightbox({ isOpen, onClose, media, initialIndex }: MediaLightboxProps): React.ReactPortal | null;
|
|
13
|
+
export {};
|
|
14
14
|
//# sourceMappingURL=MediaLightbox.d.ts.map
|
|
@@ -1,47 +1,47 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState, useEffect, useCallback } from 'react';
|
|
4
|
-
import { createPortal } from 'react-dom';
|
|
5
|
-
export function MediaLightbox({ isOpen, onClose, media, initialIndex = 0 }) {
|
|
6
|
-
const [currentIndex, setCurrentIndex] = useState(initialIndex);
|
|
7
|
-
const [mounted, setMounted] = useState(false);
|
|
8
|
-
const handlePrev = useCallback((e) => {
|
|
9
|
-
e?.stopPropagation();
|
|
10
|
-
setCurrentIndex(prev => (prev === 0 ? media.length - 1 : prev - 1));
|
|
11
|
-
}, [media.length]);
|
|
12
|
-
const handleNext = useCallback((e) => {
|
|
13
|
-
e?.stopPropagation();
|
|
14
|
-
setCurrentIndex(prev => (prev === media.length - 1 ? 0 : prev + 1));
|
|
15
|
-
}, [media.length]);
|
|
16
|
-
useEffect(() => {
|
|
17
|
-
setMounted(true);
|
|
18
|
-
if (isOpen) {
|
|
19
|
-
setCurrentIndex(initialIndex);
|
|
20
|
-
document.body.style.overflow = 'hidden';
|
|
21
|
-
}
|
|
22
|
-
// Klavye Desteği
|
|
23
|
-
const handleKeyDown = (e) => {
|
|
24
|
-
if (!isOpen)
|
|
25
|
-
return;
|
|
26
|
-
if (e.key === 'ArrowLeft')
|
|
27
|
-
handlePrev(e);
|
|
28
|
-
if (e.key === 'ArrowRight')
|
|
29
|
-
handleNext(e);
|
|
30
|
-
if (e.key === 'Escape')
|
|
31
|
-
onClose();
|
|
32
|
-
};
|
|
33
|
-
window.addEventListener('keydown', handleKeyDown);
|
|
34
|
-
return () => {
|
|
35
|
-
document.body.style.overflow = '';
|
|
36
|
-
window.removeEventListener('keydown', handleKeyDown);
|
|
37
|
-
};
|
|
38
|
-
}, [isOpen, initialIndex, handlePrev, handleNext, onClose]);
|
|
39
|
-
if (!isOpen || !media || media.length === 0 || !mounted)
|
|
40
|
-
return null;
|
|
41
|
-
const currentMedia = media[currentIndex];
|
|
42
|
-
const modalContent = (_jsxs("div", { className: "fixed inset-0 z-[9999] flex items-center justify-center animate-in fade-in duration-200", children: [_jsx("div", { className: "absolute inset-0 bg-[#0a0a0f]/95 backdrop-blur-md", onClick: onClose }), _jsx("button", { onClick: onClose, className: "absolute top-4 md:top-6 right-4 md:right-6 text-white/50 hover:text-white bg-white/10 hover:bg-white/20 p-2.5 md:p-3 rounded-full transition-all z-[10001] border border-white/10 active:scale-90", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", 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" })] }) }), media.length > 1 && (_jsxs("div", { className: "absolute top-4 md:top-6 left-4 md:left-6 text-white bg-white/10 px-4 py-1.5 rounded-full font-black text-[10px] tracking-widest z-[10001] border border-white/10 backdrop-blur-md uppercase", children: [currentIndex + 1, " / ", media.length] })), media.length > 1 && (_jsx("button", { onClick: (e) => handlePrev(e), className: "absolute left-4 md:left-8 top-1/2 -translate-y-1/2 text-white/40 hover:text-white bg-white/5 hover:bg-white/10 p-4 md:p-5 rounded-full transition-all z-[10001] border border-transparent hover:border-white/10 backdrop-blur-md group active:scale-90", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", className: "group-hover:-translate-x-0.5 transition-transform", children: _jsx("polyline", { points: "15 18 9 12 15 6" }) }) })), media.length > 1 && (_jsx("button", { onClick: (e) => handleNext(e), className: "absolute right-4 md:right-8 top-1/2 -translate-y-1/2 text-white/40 hover:text-white bg-white/5 hover:bg-white/10 p-4 md:p-5 rounded-full transition-all z-[10001] border border-transparent hover:border-white/10 backdrop-blur-md group active:scale-90", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", className: "group-hover:translate-x-0.5 transition-transform", children: _jsx("polyline", { points: "9 18 15 12 9 6" }) }) })), _jsx("div", { className: "relative w-full h-full max-w-7xl max-h-[92vh] flex items-center justify-center p-4 md:p-12 z-[10000]", onClick: onClose, children: currentMedia.type === 'video' ? (
|
|
43
|
-
// eslint-disable-next-line jsx-a11y/media-has-caption
|
|
44
|
-
_jsx("video", { src: currentMedia.url, controls: true, autoPlay: true, className: "max-w-full max-h-full rounded-2xl shadow-[0_0_80px_rgba(0,0,0,0.8)] object-contain animate-in zoom-in-95 duration-500 ring-1 ring-white/10", onClick: (e) => e.stopPropagation() })) : (_jsx("img", { src: currentMedia.url, alt: "Galeri Medyas\u0131", className: "max-w-full max-h-full rounded-2xl shadow-[0_0_80px_rgba(0,0,0,0.8)] object-contain animate-in zoom-in-95 duration-500 ring-1 ring-white/10", onClick: (e) => e.stopPropagation() })) })] }));
|
|
45
|
-
return createPortal(modalContent, document.body);
|
|
46
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState, useEffect, useCallback } from 'react';
|
|
4
|
+
import { createPortal } from 'react-dom';
|
|
5
|
+
export function MediaLightbox({ isOpen, onClose, media, initialIndex = 0 }) {
|
|
6
|
+
const [currentIndex, setCurrentIndex] = useState(initialIndex);
|
|
7
|
+
const [mounted, setMounted] = useState(false);
|
|
8
|
+
const handlePrev = useCallback((e) => {
|
|
9
|
+
e?.stopPropagation();
|
|
10
|
+
setCurrentIndex(prev => (prev === 0 ? media.length - 1 : prev - 1));
|
|
11
|
+
}, [media.length]);
|
|
12
|
+
const handleNext = useCallback((e) => {
|
|
13
|
+
e?.stopPropagation();
|
|
14
|
+
setCurrentIndex(prev => (prev === media.length - 1 ? 0 : prev + 1));
|
|
15
|
+
}, [media.length]);
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
setMounted(true);
|
|
18
|
+
if (isOpen) {
|
|
19
|
+
setCurrentIndex(initialIndex);
|
|
20
|
+
document.body.style.overflow = 'hidden';
|
|
21
|
+
}
|
|
22
|
+
// Klavye Desteği
|
|
23
|
+
const handleKeyDown = (e) => {
|
|
24
|
+
if (!isOpen)
|
|
25
|
+
return;
|
|
26
|
+
if (e.key === 'ArrowLeft')
|
|
27
|
+
handlePrev(e);
|
|
28
|
+
if (e.key === 'ArrowRight')
|
|
29
|
+
handleNext(e);
|
|
30
|
+
if (e.key === 'Escape')
|
|
31
|
+
onClose();
|
|
32
|
+
};
|
|
33
|
+
window.addEventListener('keydown', handleKeyDown);
|
|
34
|
+
return () => {
|
|
35
|
+
document.body.style.overflow = '';
|
|
36
|
+
window.removeEventListener('keydown', handleKeyDown);
|
|
37
|
+
};
|
|
38
|
+
}, [isOpen, initialIndex, handlePrev, handleNext, onClose]);
|
|
39
|
+
if (!isOpen || !media || media.length === 0 || !mounted)
|
|
40
|
+
return null;
|
|
41
|
+
const currentMedia = media[currentIndex];
|
|
42
|
+
const modalContent = (_jsxs("div", { className: "fixed inset-0 z-[9999] flex items-center justify-center animate-in fade-in duration-200", children: [_jsx("div", { className: "absolute inset-0 bg-[#0a0a0f]/95 backdrop-blur-md", onClick: onClose }), _jsx("button", { onClick: onClose, className: "absolute top-4 md:top-6 right-4 md:right-6 text-white/50 hover:text-white bg-white/10 hover:bg-white/20 p-2.5 md:p-3 rounded-full transition-all z-[10001] border border-white/10 active:scale-90", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", 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" })] }) }), media.length > 1 && (_jsxs("div", { className: "absolute top-4 md:top-6 left-4 md:left-6 text-white bg-white/10 px-4 py-1.5 rounded-full font-black text-[10px] tracking-widest z-[10001] border border-white/10 backdrop-blur-md uppercase", children: [currentIndex + 1, " / ", media.length] })), media.length > 1 && (_jsx("button", { onClick: (e) => handlePrev(e), className: "absolute left-4 md:left-8 top-1/2 -translate-y-1/2 text-white/40 hover:text-white bg-white/5 hover:bg-white/10 p-4 md:p-5 rounded-full transition-all z-[10001] border border-transparent hover:border-white/10 backdrop-blur-md group active:scale-90", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", className: "group-hover:-translate-x-0.5 transition-transform", children: _jsx("polyline", { points: "15 18 9 12 15 6" }) }) })), media.length > 1 && (_jsx("button", { onClick: (e) => handleNext(e), className: "absolute right-4 md:right-8 top-1/2 -translate-y-1/2 text-white/40 hover:text-white bg-white/5 hover:bg-white/10 p-4 md:p-5 rounded-full transition-all z-[10001] border border-transparent hover:border-white/10 backdrop-blur-md group active:scale-90", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "32", height: "32", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", className: "group-hover:translate-x-0.5 transition-transform", children: _jsx("polyline", { points: "9 18 15 12 9 6" }) }) })), _jsx("div", { className: "relative w-full h-full max-w-7xl max-h-[92vh] flex items-center justify-center p-4 md:p-12 z-[10000]", onClick: onClose, children: currentMedia.type === 'video' ? (
|
|
43
|
+
// eslint-disable-next-line jsx-a11y/media-has-caption
|
|
44
|
+
_jsx("video", { src: currentMedia.url, controls: true, autoPlay: true, className: "max-w-full max-h-full rounded-2xl shadow-[0_0_80px_rgba(0,0,0,0.8)] object-contain animate-in zoom-in-95 duration-500 ring-1 ring-white/10", onClick: (e) => e.stopPropagation() })) : (_jsx("img", { src: currentMedia.url, alt: "Galeri Medyas\u0131", className: "max-w-full max-h-full rounded-2xl shadow-[0_0_80px_rgba(0,0,0,0.8)] object-contain animate-in zoom-in-95 duration-500 ring-1 ring-white/10", onClick: (e) => e.stopPropagation() })) })] }));
|
|
45
|
+
return createPortal(modalContent, document.body);
|
|
46
|
+
}
|
|
47
47
|
//# sourceMappingURL=MediaLightbox.js.map
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { PostMedia } from './MediaLightbox';
|
|
2
|
-
import { User } from '@armoyu/core';
|
|
3
|
-
export interface PostCardProps {
|
|
4
|
-
id: string;
|
|
5
|
-
author: User | null;
|
|
6
|
-
content: string;
|
|
7
|
-
imageUrl?: string;
|
|
8
|
-
media?: PostMedia[];
|
|
9
|
-
createdAt: string;
|
|
10
|
-
stats: {
|
|
11
|
-
likes: number;
|
|
12
|
-
comments: number;
|
|
13
|
-
reposts?: number;
|
|
14
|
-
shares: number;
|
|
15
|
-
};
|
|
16
|
-
hashtags?: string[];
|
|
17
|
-
onTagClick?: (tag: string) => void;
|
|
18
|
-
isPending?: boolean;
|
|
19
|
-
likeList?: User[];
|
|
20
|
-
repostList?: User[];
|
|
21
|
-
commentList?: any[];
|
|
22
|
-
repostOf?: any;
|
|
23
|
-
}
|
|
24
|
-
export declare function PostCard({ id, author, content, imageUrl, media, createdAt, stats, hashtags, onTagClick, isPending, likeList, repostList, commentList, repostOf }: PostCardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
1
|
+
import { PostMedia } from './MediaLightbox';
|
|
2
|
+
import { User } from '@armoyu/core';
|
|
3
|
+
export interface PostCardProps {
|
|
4
|
+
id: string;
|
|
5
|
+
author: User | null;
|
|
6
|
+
content: string;
|
|
7
|
+
imageUrl?: string;
|
|
8
|
+
media?: PostMedia[];
|
|
9
|
+
createdAt: string;
|
|
10
|
+
stats: {
|
|
11
|
+
likes: number;
|
|
12
|
+
comments: number;
|
|
13
|
+
reposts?: number;
|
|
14
|
+
shares: number;
|
|
15
|
+
};
|
|
16
|
+
hashtags?: string[];
|
|
17
|
+
onTagClick?: (tag: string) => void;
|
|
18
|
+
isPending?: boolean;
|
|
19
|
+
likeList?: User[];
|
|
20
|
+
repostList?: User[];
|
|
21
|
+
commentList?: any[];
|
|
22
|
+
repostOf?: any;
|
|
23
|
+
}
|
|
24
|
+
export declare function PostCard({ id, author, content, imageUrl, media, createdAt, stats, hashtags, onTagClick, isPending, likeList, repostList, commentList, repostOf }: PostCardProps): import("react/jsx-runtime").JSX.Element | null;
|
|
25
25
|
//# sourceMappingURL=PostCard.d.ts.map
|
|
@@ -1,113 +1,113 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
-
import React, { useState } from 'react';
|
|
4
|
-
import { useRouter } from 'next/navigation';
|
|
5
|
-
import { MediaLightbox } from './MediaLightbox';
|
|
6
|
-
import { RepostModal } from './RepostModal';
|
|
7
|
-
import { PostInteractionsModal } from './PostInteractionsModal';
|
|
8
|
-
import { useAuth } from '../../../context/AuthContext';
|
|
9
|
-
import { useSocket } from '../../../context/SocketContext';
|
|
10
|
-
import { RollingNumber } from '../../RollingNumber';
|
|
11
|
-
export function PostCard({ id, author, content, imageUrl, media, createdAt, stats, hashtags, onTagClick, isPending, likeList, repostList, commentList, repostOf }) {
|
|
12
|
-
const { user } = useAuth(); // Oturum bilgisini çek
|
|
13
|
-
const { emit } = useSocket();
|
|
14
|
-
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
15
|
-
const router = useRouter();
|
|
16
|
-
const [lightboxIndex, setLightboxIndex] = useState(null);
|
|
17
|
-
if (!author)
|
|
18
|
-
return null;
|
|
19
|
-
// Repost Edilen Gönderinin Medyası
|
|
20
|
-
const repostMedia = repostOf?.media || (repostOf?.imageUrl ? [{ type: 'image', url: repostOf.imageUrl }] : []);
|
|
21
|
-
const displayMedia = media
|
|
22
|
-
? media
|
|
23
|
-
: (imageUrl ? [{ type: 'image', url: imageUrl }] : []);
|
|
24
|
-
// Interaction States
|
|
25
|
-
const [isLiked, setIsLiked] = React.useState(false);
|
|
26
|
-
const [likeCount, setLikeCount] = React.useState(stats.likes);
|
|
27
|
-
// Props değiştikçe local state'i güncelle (Soket desteği için kritik)
|
|
28
|
-
React.useEffect(() => {
|
|
29
|
-
setLikeCount(stats.likes);
|
|
30
|
-
}, [stats.likes]);
|
|
31
|
-
const [isCommentOpen, setIsCommentOpen] = React.useState(false);
|
|
32
|
-
const [isRepostModalOpen, setIsRepostModalOpen] = useState(false);
|
|
33
|
-
const [isInteractionsModalOpen, setIsInteractionsModalOpen] = useState(false);
|
|
34
|
-
const [interactionsTab, setInteractionsTab] = useState('likes');
|
|
35
|
-
const [commentText, setCommentText] = React.useState('');
|
|
36
|
-
const [commentsList, setCommentsList] = React.useState(commentList || []);
|
|
37
|
-
const [replyingTo, setReplyingTo] = useState(null); // Hangi yoruma yanıt veriliyor
|
|
38
|
-
const handleLike = () => {
|
|
39
|
-
if (isPending)
|
|
40
|
-
return;
|
|
41
|
-
const newLiked = !isLiked;
|
|
42
|
-
const newCount = newLiked ? likeCount + 1 : likeCount - 1;
|
|
43
|
-
setIsLiked(newLiked);
|
|
44
|
-
setLikeCount(newCount);
|
|
45
|
-
// Emit live update
|
|
46
|
-
emit('post_like', {
|
|
47
|
-
postId: id,
|
|
48
|
-
userId: user?.id,
|
|
49
|
-
isLiked: newLiked,
|
|
50
|
-
newCount: newCount
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
const handleCommentSubmit = () => {
|
|
54
|
-
if (!commentText.trim())
|
|
55
|
-
return;
|
|
56
|
-
const dynamicAuthorName = user?.displayName?.split(' ')[0] || 'Kullanıcı';
|
|
57
|
-
if (replyingTo) {
|
|
58
|
-
// Yanıtı Ana Yoruma Ekle
|
|
59
|
-
setCommentsList(prev => prev.map(c => {
|
|
60
|
-
if (c.id === replyingTo) {
|
|
61
|
-
return {
|
|
62
|
-
...c,
|
|
63
|
-
replies: [...(c.replies || []), {
|
|
64
|
-
id: Date.now().toString(),
|
|
65
|
-
author: dynamicAuthorName,
|
|
66
|
-
text: commentText,
|
|
67
|
-
date: 'Şimdi'
|
|
68
|
-
}]
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
return c;
|
|
72
|
-
}));
|
|
73
|
-
setReplyingTo(null);
|
|
74
|
-
}
|
|
75
|
-
else {
|
|
76
|
-
// Normal Ana Yorum Ekle
|
|
77
|
-
setCommentsList(prev => [...prev, {
|
|
78
|
-
id: Date.now().toString(),
|
|
79
|
-
author: dynamicAuthorName,
|
|
80
|
-
text: commentText,
|
|
81
|
-
date: 'Şimdi',
|
|
82
|
-
replies: []
|
|
83
|
-
}]);
|
|
84
|
-
}
|
|
85
|
-
setCommentText('');
|
|
86
|
-
};
|
|
87
|
-
const goToProfile = () => {
|
|
88
|
-
router.push(author.getProfileUrl());
|
|
89
|
-
};
|
|
90
|
-
return (_jsxs("div", { className: `w-full bg-armoyu-card-bg border border-armoyu-card-border rounded-3xl overflow-hidden shadow-sm hover:shadow-md transition-all duration-300 relative ${isPending ? 'opacity-70 pointer-events-none' : ''}`, children: [isPending && (_jsxs("div", { className: "absolute top-4 right-4 z-30 bg-blue-600/90 backdrop-blur-md px-4 py-1.5 rounded-full border border-white/20 shadow-xl flex items-center gap-2 animate-pulse", children: [_jsx("div", { className: "w-2.5 h-2.5 border-2 border-white/20 border-t-white rounded-full animate-spin" }), _jsx("span", { className: "text-[10px] font-black text-white uppercase tracking-widest", children: "G\u00F6nderiliyor..." })] })), _jsxs("div", { className: "p-5 flex items-start gap-4", children: [_jsx("img", { src: author.avatar, alt: author.displayName, className: "w-12 h-12 rounded-full border-2 border-transparent hover:border-blue-500 transition-colors shadow-sm bg-black/5 dark:bg-white/5 object-cover cursor-pointer", onClick: goToProfile, title: "Profile Git" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [_jsx("h3", { className: "font-bold text-armoyu-text truncate max-w-[200px] cursor-pointer hover:text-blue-500 transition-colors", onClick: goToProfile, title: "Profile Git", children: author.displayName }), author.verified && (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", className: "text-blue-500", children: _jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }) })), author.role?.name && (_jsx("span", { style: {
|
|
91
|
-
backgroundColor: `${author.role.color}15`,
|
|
92
|
-
color: author.role.color,
|
|
93
|
-
borderColor: `${author.role.color}40`
|
|
94
|
-
}, className: "text-[10px] font-bold px-2 py-0.5 rounded-md uppercase tracking-wider border", children: author.role.name }))] }), _jsxs("div", { className: "relative flex items-center gap-1", children: [user?.username === author.username && (_jsx("button", { className: "text-armoyu-text-muted hover:text-blue-500 p-1.5 transition-colors bg-blue-500/5 rounded-lg border border-blue-500/10", title: "D\u00FCzenle", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" }) }) })), _jsx("button", { onClick: () => setIsMenuOpen(!isMenuOpen), className: "text-armoyu-text-muted hover:text-blue-500 p-1 transition-colors", title: "Se\u00E7enekler", 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: "1" }), _jsx("circle", { cx: "19", cy: "12", r: "1" }), _jsx("circle", { cx: "5", cy: "12", r: "1" })] }) }), isMenuOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: () => setIsMenuOpen(false) }), _jsxs("div", { className: "absolute right-0 mt-1 w-56 bg-armoyu-drawer-bg border border-gray-200 dark:border-white/10 rounded-xl shadow-xl z-50 py-1.5 animate-in fade-in zoom-in-95 duration-200", children: [user?.username === author.username && (_jsxs("button", { onClick: () => setIsMenuOpen(false), className: "w-full text-left px-4 py-2.5 text-sm font-bold text-blue-500 hover:bg-blue-500/10 transition-colors flex items-center gap-3", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), _jsx("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })] }), "G\u00F6nderiyi D\u00FCzenle"] })), _jsxs("button", { onClick: () => setIsMenuOpen(false), className: "w-full text-left px-4 py-2.5 text-sm font-medium text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-colors flex items-center gap-3", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" }) }), "G\u00F6nderiyi Kaydet"] }), _jsxs("button", { onClick: () => setIsMenuOpen(false), className: "w-full text-left px-4 py-2.5 text-sm font-bold text-red-600 dark:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors flex items-center gap-3 border-t border-gray-100 dark:border-white/5 mt-1 pt-2.5", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z" }), _jsx("line", { x1: "4", y1: "22", x2: "4", y2: "15" })] }), "G\u00F6nderiyi \u015Eikayet Et"] })] })] }))] })] }), _jsxs("div", { className: "flex items-center gap-2 text-xs font-medium text-armoyu-text-muted mt-0.5", children: [_jsxs("span", { className: "text-blue-600 dark:text-blue-400 font-bold cursor-pointer hover:underline", onClick: goToProfile, children: ["@", author.username] }), _jsx("span", { children: "\u2022" }), _jsx("span", { children: createdAt })] })] })] }), _jsxs("div", { className: "px-5 pb-3", children: [_jsx("p", { className: "text-sm md:text-base text-armoyu-text leading-relaxed whitespace-pre-wrap font-medium", children: content.split(/(\s+)/).map((part, i) => {
|
|
95
|
-
if (part.startsWith('#')) {
|
|
96
|
-
return (_jsx("button", { onClick: (e) => {
|
|
97
|
-
e.stopPropagation();
|
|
98
|
-
onTagClick?.(part);
|
|
99
|
-
}, className: "text-blue-500 hover:underline inline-block font-bold", children: part }, i));
|
|
100
|
-
}
|
|
101
|
-
return part;
|
|
102
|
-
}) }), repostOf && (_jsxs("div", { className: "mt-4 rounded-2xl border border-black/10 dark:border-white/10 overflow-hidden bg-black/5 dark:bg-black/20 hover:border-blue-500/30 transition-all cursor-pointer group/repost", onClick: (e) => {
|
|
103
|
-
e.stopPropagation();
|
|
104
|
-
router.push(`/?post=${repostOf.id}`);
|
|
105
|
-
}, children: [_jsxs("div", { className: "p-3 flex items-center gap-2 border-b border-black/5 dark:border-white/5", children: [_jsx("img", { src: repostOf.author?.avatar, className: "w-5 h-5 rounded-full object-cover", alt: "" }), _jsx("span", { className: "text-[11px] font-black text-armoyu-text uppercase tracking-tight", children: repostOf.author?.displayName }), _jsxs("span", { className: "text-[10px] font-bold text-armoyu-text-muted opacity-60", children: ["@", repostOf.author?.username] }), _jsx("span", { className: "text-[10px] text-armoyu-text-muted ml-auto", children: repostOf.createdAt })] }), _jsxs("div", { className: "p-4 pt-3", children: [_jsx("p", { className: "text-xs text-armoyu-text-muted line-clamp-3 leading-relaxed", children: repostOf.content }), repostMedia.length > 0 && (_jsx("div", { className: "mt-3 rounded-xl overflow-hidden grid grid-cols-2 gap-1 aspect-[21/9]", children: repostMedia.slice(0, 4).map((m, i) => (_jsxs("div", { className: `relative ${repostMedia.length === 1 ? 'col-span-2' : ''}`, children: [_jsx("img", { src: m.url, className: "w-full h-full object-cover brightness-95 group-hover/repost:scale-105 transition-transform duration-700", alt: "" }), m.type === 'video' && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/20", children: _jsx("div", { className: "w-6 h-6 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center text-white", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "currentColor", children: _jsx("polygon", { points: "5 3 19 12 5 21 5 3" }) }) }) }))] }, i))) }))] })] }))] }), displayMedia.length > 0 && (_jsx("div", { className: "px-5 pb-5", children: _jsx("div", { className: `grid gap-1.5 overflow-hidden rounded-2xl border border-black/5 dark:border-white/10 shadow-sm ${displayMedia.length === 1 ? 'grid-cols-1' : displayMedia.length === 2 ? 'grid-cols-2 aspect-[16/9]' : displayMedia.length === 3 ? 'grid-cols-2 aspect-[16/9]' : 'grid-cols-2 aspect-square md:aspect-[16/9]'}`, children: displayMedia.slice(0, 4).map((m, idx) => (_jsxs("div", { className: `relative cursor-pointer group bg-black/5 dark:bg-white/5 ${displayMedia.length === 3 && idx === 0 ? 'row-span-2' : ''}`, onClick: () => setLightboxIndex(idx), children: [m.type === 'video' ? (
|
|
106
|
-
// eslint-disable-next-line jsx-a11y/media-has-caption
|
|
107
|
-
_jsx("video", { src: m.url, className: "w-full h-full object-cover" })) : (_jsx("img", { src: m.url, alt: "Medya", className: "w-full h-full object-cover group-hover:scale-[1.03] transition-transform duration-500" })), m.type === 'video' && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/20 group-hover:bg-black/40 transition-colors z-10", children: _jsx("div", { className: "w-12 h-12 rounded-full bg-white/20 backdrop-blur-md flex items-center justify-center text-white border border-white/30 shadow-lg", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", stroke: "none", children: _jsx("polygon", { points: "5 3 19 12 5 21 5 3" }) }) }) })), displayMedia.length > 4 && idx === 3 && (_jsxs("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center text-white font-black text-2xl md:text-3xl z-20", children: ["+", displayMedia.length - 4] }))] }, idx))) }) })), likeList && likeList.length > 0 && (_jsxs("div", { className: "px-6 py-2 flex items-center gap-2.5 bg-black/5 dark:bg-white/2 border-y border-armoyu-card-border/50 transition-all hover:bg-black/10 dark:hover:bg-white/5 cursor-pointer", onClick: () => { setInteractionsTab('likes'); setIsInteractionsModalOpen(true); }, children: [_jsx("div", { className: "flex -space-x-2.5 overflow-hidden", children: likeList.slice(0, 3).map((l, i) => (_jsx("img", { src: l.avatar, alt: l.displayName, className: "inline-block h-6 w-6 rounded-full ring-2 ring-armoyu-card-bg bg-armoyu-card-bg object-cover shadow-sm transition-transform hover:scale-110 hover:z-10", title: l.displayName }, i))) }), _jsx("div", { className: "text-[11px] font-bold text-armoyu-text-muted flex items-center gap-1", children: likeCount > 0 && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-armoyu-text", children: likeList[0].displayName }), likeCount > 1 && (_jsxs(_Fragment, { children: [_jsx("span", { children: "ve" }), _jsxs("span", { className: "text-armoyu-text", children: [likeCount - 1, " di\u011Fer ki\u015Fi"] })] })), _jsx("span", { children: "be\u011Fendi" })] })) })] })), _jsxs("div", { className: "px-5 py-3.5 border-t border-armoyu-card-border flex justify-between items-center bg-black/5 dark:bg-white/5", children: [_jsxs("div", { className: "flex gap-6", children: [_jsxs("div", { className: "flex items-center", children: [_jsx("button", { onClick: handleLike, className: `flex items-center gap-2 text-sm font-bold transition-colors group ${isLiked ? 'text-blue-500' : 'text-armoyu-text-muted hover:text-blue-500'}`, children: _jsx("div", { className: `p-1.5 rounded-full transition-colors ${isLiked ? 'bg-blue-500/10' : 'group-hover:bg-blue-500/10'}`, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: isLiked ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", className: "group-hover:-translate-y-0.5 transition-transform", children: _jsx("path", { d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" }) }) }) }), likeCount > 0 && (_jsx("button", { onClick: () => { setInteractionsTab('likes'); setIsInteractionsModalOpen(true); }, className: "text-sm font-black text-armoyu-text-muted hover:text-blue-500 transition-colors ml-1 px-1", children: _jsx(RollingNumber, { value: likeCount }) }))] }), _jsxs("button", { onClick: () => setIsCommentOpen(!isCommentOpen), className: `flex items-center gap-2 text-sm font-bold transition-colors group ${isCommentOpen ? 'text-emerald-500' : 'text-armoyu-text-muted hover:text-emerald-500'}`, title: "Yorum Yap", children: [_jsx("div", { className: `p-1.5 rounded-full transition-colors ${isCommentOpen ? 'bg-emerald-500/10' : 'group-hover:bg-emerald-500/10'}`, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "group-hover:-translate-y-0.5 transition-transform", children: _jsx("path", { d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" }) }) }), (stats.comments + commentsList.length + commentsList.reduce((acc, c) => acc + (c.replies?.length || 0), 0)) > 0 &&
|
|
108
|
-
(stats.comments + commentsList.length + commentsList.reduce((acc, c) => acc + (c.replies?.length || 0), 0))] }), _jsxs("div", { className: "flex items-center", children: [_jsx("button", { onClick: () => setIsRepostModalOpen(true), className: "flex items-center gap-2 text-sm font-bold text-armoyu-text-muted hover:text-green-500 transition-colors group", title: "Yeniden Payla\u015F (Retweet)", children: _jsx("div", { className: "p-1.5 rounded-full group-hover:bg-green-500/10 transition-colors", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "group-hover:-translate-y-0.5 transition-transform", children: [_jsx("polyline", { points: "17 1 21 5 17 9" }), _jsx("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), _jsx("polyline", { points: "7 23 3 19 7 15" }), _jsx("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })] }) }) }), stats.reposts && stats.reposts > 0 && (_jsx("button", { onClick: () => { setInteractionsTab('reposts'); setIsInteractionsModalOpen(true); }, className: "text-sm font-black text-armoyu-text-muted hover:text-green-500 transition-colors ml-1 px-1", children: stats.reposts }))] })] }), _jsx("button", { className: "flex items-center gap-2 text-sm font-bold text-armoyu-text-muted hover:text-purple-500 transition-colors group", children: _jsx("div", { className: "p-1.5 rounded-full group-hover:bg-purple-500/10 transition-colors", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "group-hover:-translate-y-0.5 transition-transform", children: [_jsx("circle", { cx: "18", cy: "5", r: "3" }), _jsx("circle", { cx: "6", cy: "12", r: "3" }), _jsx("circle", { cx: "18", cy: "19", r: "3" }), _jsx("line", { x1: "8.59", y1: "13.51", x2: "15.42", y2: "17.49" }), _jsx("line", { x1: "15.41", y1: "6.51", x2: "8.59", y2: "10.49" })] }) }) })] }), isCommentOpen && (_jsxs("div", { className: "bg-black/5 dark:bg-white/5 border-t border-armoyu-card-border p-4 animate-in fade-in slide-in-from-top-2 duration-200", children: [replyingTo && (_jsxs("div", { className: "flex justify-between items-center mb-2.5 px-2", children: [_jsxs("span", { className: "text-xs font-bold text-blue-500 flex items-center gap-1.5", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("polyline", { points: "15 10 20 15 15 20" }), _jsx("path", { d: "M4 4v7a4 4 0 0 0 4 4h12" })] }), _jsx("span", { className: "text-armoyu-text-muted", children: "Yan\u0131tlan\u0131yor:" }), " @", (() => {
|
|
109
|
-
const author = commentsList.find(c => c.id === replyingTo)?.author;
|
|
110
|
-
return typeof author === 'string' ? author : author?.displayName;
|
|
111
|
-
})()] }), _jsx("button", { onClick: () => setReplyingTo(null), className: "text-[11px] font-black uppercase tracking-wider text-armoyu-text-muted hover:text-red-500 transition-colors bg-black/5 dark:bg-white/5 px-2 py-1 rounded-md", children: "\u0130ptal Et" })] })), _jsxs("div", { className: "flex gap-3 mb-2 animate-in fade-in zoom-in-95 duration-300", children: [_jsx("img", { src: user?.avatar || "https://api.dicebear.com/7.x/avataaars/svg?seed=Berkay", alt: "Sen", className: "w-9 h-9 rounded-full bg-white/5 border border-white/10 shrink-0 shadow-sm object-cover" }), _jsxs("div", { className: "flex-1 flex items-center bg-black/5 dark:bg-white/5 border border-gray-200 dark:border-white/10 rounded-2xl px-3 py-1.5 shadow-sm focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 transition-all", children: [_jsx("input", { type: "text", value: commentText, onChange: (e) => setCommentText(e.target.value), onKeyDown: (e) => e.key === 'Enter' && handleCommentSubmit(), placeholder: replyingTo ? "Yanıtını yaz..." : "Fikrini paylaş...", className: "flex-1 bg-transparent border-none outline-none text-sm text-armoyu-text placeholder:text-armoyu-text-muted font-medium" }), _jsx("button", { onClick: handleCommentSubmit, disabled: !commentText.trim(), className: "p-2 ml-2 text-blue-500 disabled:text-gray-400 dark:disabled:text-gray-600 disabled:cursor-not-allowed hover:bg-blue-500/10 rounded-xl transition-colors shrink-0", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "22", y1: "2", x2: "11", y2: "13" }), _jsx("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })] }) })] })] }), commentsList.length > 0 && (_jsx("div", { className: "space-y-4 mt-5 px-1", children: commentsList.map((c) => (_jsxs("div", { className: "animate-in fade-in slide-in-from-left-2 zoom-in-95 duration-500", children: [_jsxs("div", { className: "flex gap-3", children: [_jsx("img", { src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${typeof c.author === 'string' ? c.author : c.author?.displayName}`, alt: typeof c.author === 'string' ? c.author : c.author?.displayName, className: "w-8 h-8 rounded-full bg-white/5 border border-black/10 dark:border-white/10 shrink-0 mt-1 shadow-sm" }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "bg-armoyu-drawer-bg border border-gray-200 dark:border-white/5 rounded-2xl rounded-tl-sm px-4 py-2 shadow-sm inline-block min-w-[30%]", children: [_jsx("div", { className: "text-xs font-black text-armoyu-text mb-0.5", children: typeof c.author === 'string' ? c.author : c.author?.displayName }), _jsx("div", { className: "text-sm font-medium text-armoyu-text-muted", children: c.text || c.content })] }), _jsxs("div", { className: "flex items-center gap-4 mt-1.5 ml-2 text-[11px] font-bold text-armoyu-text-muted", children: [_jsx("span", { className: "hover:text-blue-500 cursor-pointer transition-colors", children: "Be\u011Fen" }), _jsx("span", { onClick: () => { setReplyingTo(c.id); setCommentText(''); }, className: "hover:text-blue-500 cursor-pointer transition-colors", children: "Yan\u0131tla" }), _jsx("span", { className: "opacity-50", children: c.date || c.createdAt })] })] })] }), c.replies && c.replies.length > 0 && (_jsx("div", { className: "mt-3 ml-11 space-y-3 border-l-2 border-black/10 dark:border-white/10 pl-4", children: c.replies.map(r => (_jsxs("div", { className: "flex gap-2.5 animate-in fade-in slide-in-from-left-2 duration-300", children: [_jsx("img", { src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${typeof r.author === 'string' ? r.author : r.author?.displayName}`, alt: typeof r.author === 'string' ? r.author : r.author?.displayName, className: "w-6 h-6 rounded-full bg-white/5 border border-black/10 dark:border-white/10 shrink-0 mt-0.5 shadow-sm relative -left-[27px] ring-4 ring-black/5 dark:ring-[#0a0a0e]/60" }), _jsxs("div", { className: "flex-1 -ml-[18px]", children: [_jsxs("div", { className: "bg-armoyu-drawer-bg border border-gray-200 dark:border-white/5 rounded-2xl rounded-tl-sm px-3.5 py-1.5 shadow-sm inline-block", children: [_jsx("span", { className: "text-xs font-black text-armoyu-text mr-2", children: typeof r.author === 'string' ? r.author : r.author?.displayName }), _jsx("span", { className: "text-[13px] font-medium text-armoyu-text-muted", children: r.text || r.content })] }), _jsxs("div", { className: "flex items-center gap-4 mt-1 ml-2 text-[10px] font-bold text-armoyu-text-muted", children: [_jsx("span", { className: "hover:text-blue-500 cursor-pointer transition-colors", children: "Be\u011Fen" }), _jsx("span", { onClick: () => { setReplyingTo(c.id); setCommentText(''); }, className: "hover:text-blue-500 cursor-pointer transition-colors", children: "Yan\u0131tla" }), _jsx("span", { className: "opacity-50", children: r.date || r.createdAt })] })] })] }, r.id))) }))] }, c.id))) }))] })), _jsx(RepostModal, { isOpen: isRepostModalOpen, onClose: () => setIsRepostModalOpen(false), post: { id, author, content, media, createdAt, stats } }), _jsx(PostInteractionsModal, { isOpen: isInteractionsModalOpen, onClose: () => setIsInteractionsModalOpen(false), title: interactionsTab === 'likes' ? 'Beğenenler' : 'Paylaşanlar', likes: likeList, reposts: repostList, defaultTab: interactionsTab }), lightboxIndex !== null && (_jsx(MediaLightbox, { isOpen: lightboxIndex !== null, onClose: () => setLightboxIndex(null), media: displayMedia, initialIndex: lightboxIndex }))] }));
|
|
112
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { useRouter } from 'next/navigation';
|
|
5
|
+
import { MediaLightbox } from './MediaLightbox';
|
|
6
|
+
import { RepostModal } from './RepostModal';
|
|
7
|
+
import { PostInteractionsModal } from './PostInteractionsModal';
|
|
8
|
+
import { useAuth } from '../../../context/AuthContext';
|
|
9
|
+
import { useSocket } from '../../../context/SocketContext';
|
|
10
|
+
import { RollingNumber } from '../../RollingNumber';
|
|
11
|
+
export function PostCard({ id, author, content, imageUrl, media, createdAt, stats, hashtags, onTagClick, isPending, likeList, repostList, commentList, repostOf }) {
|
|
12
|
+
const { user } = useAuth(); // Oturum bilgisini çek
|
|
13
|
+
const { emit } = useSocket();
|
|
14
|
+
const [isMenuOpen, setIsMenuOpen] = useState(false);
|
|
15
|
+
const router = useRouter();
|
|
16
|
+
const [lightboxIndex, setLightboxIndex] = useState(null);
|
|
17
|
+
if (!author)
|
|
18
|
+
return null;
|
|
19
|
+
// Repost Edilen Gönderinin Medyası
|
|
20
|
+
const repostMedia = repostOf?.media || (repostOf?.imageUrl ? [{ type: 'image', url: repostOf.imageUrl }] : []);
|
|
21
|
+
const displayMedia = media
|
|
22
|
+
? media
|
|
23
|
+
: (imageUrl ? [{ type: 'image', url: imageUrl }] : []);
|
|
24
|
+
// Interaction States
|
|
25
|
+
const [isLiked, setIsLiked] = React.useState(false);
|
|
26
|
+
const [likeCount, setLikeCount] = React.useState(stats.likes);
|
|
27
|
+
// Props değiştikçe local state'i güncelle (Soket desteği için kritik)
|
|
28
|
+
React.useEffect(() => {
|
|
29
|
+
setLikeCount(stats.likes);
|
|
30
|
+
}, [stats.likes]);
|
|
31
|
+
const [isCommentOpen, setIsCommentOpen] = React.useState(false);
|
|
32
|
+
const [isRepostModalOpen, setIsRepostModalOpen] = useState(false);
|
|
33
|
+
const [isInteractionsModalOpen, setIsInteractionsModalOpen] = useState(false);
|
|
34
|
+
const [interactionsTab, setInteractionsTab] = useState('likes');
|
|
35
|
+
const [commentText, setCommentText] = React.useState('');
|
|
36
|
+
const [commentsList, setCommentsList] = React.useState(commentList || []);
|
|
37
|
+
const [replyingTo, setReplyingTo] = useState(null); // Hangi yoruma yanıt veriliyor
|
|
38
|
+
const handleLike = () => {
|
|
39
|
+
if (isPending)
|
|
40
|
+
return;
|
|
41
|
+
const newLiked = !isLiked;
|
|
42
|
+
const newCount = newLiked ? likeCount + 1 : likeCount - 1;
|
|
43
|
+
setIsLiked(newLiked);
|
|
44
|
+
setLikeCount(newCount);
|
|
45
|
+
// Emit live update
|
|
46
|
+
emit('post_like', {
|
|
47
|
+
postId: id,
|
|
48
|
+
userId: user?.id,
|
|
49
|
+
isLiked: newLiked,
|
|
50
|
+
newCount: newCount
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
const handleCommentSubmit = () => {
|
|
54
|
+
if (!commentText.trim())
|
|
55
|
+
return;
|
|
56
|
+
const dynamicAuthorName = user?.displayName?.split(' ')[0] || 'Kullanıcı';
|
|
57
|
+
if (replyingTo) {
|
|
58
|
+
// Yanıtı Ana Yoruma Ekle
|
|
59
|
+
setCommentsList(prev => prev.map(c => {
|
|
60
|
+
if (c.id === replyingTo) {
|
|
61
|
+
return {
|
|
62
|
+
...c,
|
|
63
|
+
replies: [...(c.replies || []), {
|
|
64
|
+
id: Date.now().toString(),
|
|
65
|
+
author: dynamicAuthorName,
|
|
66
|
+
text: commentText,
|
|
67
|
+
date: 'Şimdi'
|
|
68
|
+
}]
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
return c;
|
|
72
|
+
}));
|
|
73
|
+
setReplyingTo(null);
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
// Normal Ana Yorum Ekle
|
|
77
|
+
setCommentsList(prev => [...prev, {
|
|
78
|
+
id: Date.now().toString(),
|
|
79
|
+
author: dynamicAuthorName,
|
|
80
|
+
text: commentText,
|
|
81
|
+
date: 'Şimdi',
|
|
82
|
+
replies: []
|
|
83
|
+
}]);
|
|
84
|
+
}
|
|
85
|
+
setCommentText('');
|
|
86
|
+
};
|
|
87
|
+
const goToProfile = () => {
|
|
88
|
+
router.push(author.getProfileUrl());
|
|
89
|
+
};
|
|
90
|
+
return (_jsxs("div", { className: `w-full bg-armoyu-card-bg border border-armoyu-card-border rounded-3xl overflow-hidden shadow-sm hover:shadow-md transition-all duration-300 relative ${isPending ? 'opacity-70 pointer-events-none' : ''}`, children: [isPending && (_jsxs("div", { className: "absolute top-4 right-4 z-30 bg-blue-600/90 backdrop-blur-md px-4 py-1.5 rounded-full border border-white/20 shadow-xl flex items-center gap-2 animate-pulse", children: [_jsx("div", { className: "w-2.5 h-2.5 border-2 border-white/20 border-t-white rounded-full animate-spin" }), _jsx("span", { className: "text-[10px] font-black text-white uppercase tracking-widest", children: "G\u00F6nderiliyor..." })] })), _jsxs("div", { className: "p-5 flex items-start gap-4", children: [_jsx("img", { src: author.avatar, alt: author.displayName, className: "w-12 h-12 rounded-full border-2 border-transparent hover:border-blue-500 transition-colors shadow-sm bg-black/5 dark:bg-white/5 object-cover cursor-pointer", onClick: goToProfile, title: "Profile Git" }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsxs("div", { className: "flex items-center justify-between", children: [_jsxs("div", { className: "flex items-center gap-1.5 flex-wrap", children: [_jsx("h3", { className: "font-bold text-armoyu-text truncate max-w-[200px] cursor-pointer hover:text-blue-500 transition-colors", onClick: goToProfile, title: "Profile Git", children: author.displayName }), author.verified && (_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "currentColor", className: "text-blue-500", children: _jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }) })), author.role?.name && (_jsx("span", { style: {
|
|
91
|
+
backgroundColor: `${author.role.color}15`,
|
|
92
|
+
color: author.role.color,
|
|
93
|
+
borderColor: `${author.role.color}40`
|
|
94
|
+
}, className: "text-[10px] font-bold px-2 py-0.5 rounded-md uppercase tracking-wider border", children: author.role.name }))] }), _jsxs("div", { className: "relative flex items-center gap-1", children: [user?.username === author.username && (_jsx("button", { className: "text-armoyu-text-muted hover:text-blue-500 p-1.5 transition-colors bg-blue-500/5 rounded-lg border border-blue-500/10", title: "D\u00FCzenle", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M17 3a2.828 2.828 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5L17 3z" }) }) })), _jsx("button", { onClick: () => setIsMenuOpen(!isMenuOpen), className: "text-armoyu-text-muted hover:text-blue-500 p-1 transition-colors", title: "Se\u00E7enekler", 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: "1" }), _jsx("circle", { cx: "19", cy: "12", r: "1" }), _jsx("circle", { cx: "5", cy: "12", r: "1" })] }) }), isMenuOpen && (_jsxs(_Fragment, { children: [_jsx("div", { className: "fixed inset-0 z-40", onClick: () => setIsMenuOpen(false) }), _jsxs("div", { className: "absolute right-0 mt-1 w-56 bg-armoyu-drawer-bg border border-gray-200 dark:border-white/10 rounded-xl shadow-xl z-50 py-1.5 animate-in fade-in zoom-in-95 duration-200", children: [user?.username === author.username && (_jsxs("button", { onClick: () => setIsMenuOpen(false), className: "w-full text-left px-4 py-2.5 text-sm font-bold text-blue-500 hover:bg-blue-500/10 transition-colors flex items-center gap-3", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }), _jsx("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })] }), "G\u00F6nderiyi D\u00FCzenle"] })), _jsxs("button", { onClick: () => setIsMenuOpen(false), className: "w-full text-left px-4 py-2.5 text-sm font-medium text-armoyu-text hover:bg-black/5 dark:hover:bg-white/5 transition-colors flex items-center gap-3", children: [_jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: _jsx("path", { d: "M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z" }) }), "G\u00F6nderiyi Kaydet"] }), _jsxs("button", { onClick: () => setIsMenuOpen(false), className: "w-full text-left px-4 py-2.5 text-sm font-bold text-red-600 dark:text-red-500 hover:bg-red-50 dark:hover:bg-red-500/10 transition-colors flex items-center gap-3 border-t border-gray-100 dark:border-white/5 mt-1 pt-2.5", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("path", { d: "M4 15s1-1 4-1 5 2 8 2 4-1 4-1V3s-1 1-4 1-5-2-8-2-4 1-4 1z" }), _jsx("line", { x1: "4", y1: "22", x2: "4", y2: "15" })] }), "G\u00F6nderiyi \u015Eikayet Et"] })] })] }))] })] }), _jsxs("div", { className: "flex items-center gap-2 text-xs font-medium text-armoyu-text-muted mt-0.5", children: [_jsxs("span", { className: "text-blue-600 dark:text-blue-400 font-bold cursor-pointer hover:underline", onClick: goToProfile, children: ["@", author.username] }), _jsx("span", { children: "\u2022" }), _jsx("span", { children: createdAt })] })] })] }), _jsxs("div", { className: "px-5 pb-3", children: [_jsx("p", { className: "text-sm md:text-base text-armoyu-text leading-relaxed whitespace-pre-wrap font-medium", children: content.split(/(\s+)/).map((part, i) => {
|
|
95
|
+
if (part.startsWith('#')) {
|
|
96
|
+
return (_jsx("button", { onClick: (e) => {
|
|
97
|
+
e.stopPropagation();
|
|
98
|
+
onTagClick?.(part);
|
|
99
|
+
}, className: "text-blue-500 hover:underline inline-block font-bold", children: part }, i));
|
|
100
|
+
}
|
|
101
|
+
return part;
|
|
102
|
+
}) }), repostOf && (_jsxs("div", { className: "mt-4 rounded-2xl border border-black/10 dark:border-white/10 overflow-hidden bg-black/5 dark:bg-black/20 hover:border-blue-500/30 transition-all cursor-pointer group/repost", onClick: (e) => {
|
|
103
|
+
e.stopPropagation();
|
|
104
|
+
router.push(`/?post=${repostOf.id}`);
|
|
105
|
+
}, children: [_jsxs("div", { className: "p-3 flex items-center gap-2 border-b border-black/5 dark:border-white/5", children: [_jsx("img", { src: repostOf.author?.avatar, className: "w-5 h-5 rounded-full object-cover", alt: "" }), _jsx("span", { className: "text-[11px] font-black text-armoyu-text uppercase tracking-tight", children: repostOf.author?.displayName }), _jsxs("span", { className: "text-[10px] font-bold text-armoyu-text-muted opacity-60", children: ["@", repostOf.author?.username] }), _jsx("span", { className: "text-[10px] text-armoyu-text-muted ml-auto", children: repostOf.createdAt })] }), _jsxs("div", { className: "p-4 pt-3", children: [_jsx("p", { className: "text-xs text-armoyu-text-muted line-clamp-3 leading-relaxed", children: repostOf.content }), repostMedia.length > 0 && (_jsx("div", { className: "mt-3 rounded-xl overflow-hidden grid grid-cols-2 gap-1 aspect-[21/9]", children: repostMedia.slice(0, 4).map((m, i) => (_jsxs("div", { className: `relative ${repostMedia.length === 1 ? 'col-span-2' : ''}`, children: [_jsx("img", { src: m.url, className: "w-full h-full object-cover brightness-95 group-hover/repost:scale-105 transition-transform duration-700", alt: "" }), m.type === 'video' && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/20", children: _jsx("div", { className: "w-6 h-6 rounded-full bg-white/20 backdrop-blur-sm flex items-center justify-center text-white", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "currentColor", children: _jsx("polygon", { points: "5 3 19 12 5 21 5 3" }) }) }) }))] }, i))) }))] })] }))] }), displayMedia.length > 0 && (_jsx("div", { className: "px-5 pb-5", children: _jsx("div", { className: `grid gap-1.5 overflow-hidden rounded-2xl border border-black/5 dark:border-white/10 shadow-sm ${displayMedia.length === 1 ? 'grid-cols-1' : displayMedia.length === 2 ? 'grid-cols-2 aspect-[16/9]' : displayMedia.length === 3 ? 'grid-cols-2 aspect-[16/9]' : 'grid-cols-2 aspect-square md:aspect-[16/9]'}`, children: displayMedia.slice(0, 4).map((m, idx) => (_jsxs("div", { className: `relative cursor-pointer group bg-black/5 dark:bg-white/5 ${displayMedia.length === 3 && idx === 0 ? 'row-span-2' : ''}`, onClick: () => setLightboxIndex(idx), children: [m.type === 'video' ? (
|
|
106
|
+
// eslint-disable-next-line jsx-a11y/media-has-caption
|
|
107
|
+
_jsx("video", { src: m.url, className: "w-full h-full object-cover" })) : (_jsx("img", { src: m.url, alt: "Medya", className: "w-full h-full object-cover group-hover:scale-[1.03] transition-transform duration-500" })), m.type === 'video' && (_jsx("div", { className: "absolute inset-0 flex items-center justify-center bg-black/20 group-hover:bg-black/40 transition-colors z-10", children: _jsx("div", { className: "w-12 h-12 rounded-full bg-white/20 backdrop-blur-md flex items-center justify-center text-white border border-white/30 shadow-lg", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "24", height: "24", viewBox: "0 0 24 24", fill: "currentColor", stroke: "none", children: _jsx("polygon", { points: "5 3 19 12 5 21 5 3" }) }) }) })), displayMedia.length > 4 && idx === 3 && (_jsxs("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-sm flex items-center justify-center text-white font-black text-2xl md:text-3xl z-20", children: ["+", displayMedia.length - 4] }))] }, idx))) }) })), likeList && likeList.length > 0 && (_jsxs("div", { className: "px-6 py-2 flex items-center gap-2.5 bg-black/5 dark:bg-white/2 border-y border-armoyu-card-border/50 transition-all hover:bg-black/10 dark:hover:bg-white/5 cursor-pointer", onClick: () => { setInteractionsTab('likes'); setIsInteractionsModalOpen(true); }, children: [_jsx("div", { className: "flex -space-x-2.5 overflow-hidden", children: likeList.slice(0, 3).map((l, i) => (_jsx("img", { src: l.avatar, alt: l.displayName, className: "inline-block h-6 w-6 rounded-full ring-2 ring-armoyu-card-bg bg-armoyu-card-bg object-cover shadow-sm transition-transform hover:scale-110 hover:z-10", title: l.displayName }, i))) }), _jsx("div", { className: "text-[11px] font-bold text-armoyu-text-muted flex items-center gap-1", children: likeCount > 0 && (_jsxs(_Fragment, { children: [_jsx("span", { className: "text-armoyu-text", children: likeList[0].displayName }), likeCount > 1 && (_jsxs(_Fragment, { children: [_jsx("span", { children: "ve" }), _jsxs("span", { className: "text-armoyu-text", children: [likeCount - 1, " di\u011Fer ki\u015Fi"] })] })), _jsx("span", { children: "be\u011Fendi" })] })) })] })), _jsxs("div", { className: "px-5 py-3.5 border-t border-armoyu-card-border flex justify-between items-center bg-black/5 dark:bg-white/5", children: [_jsxs("div", { className: "flex gap-6", children: [_jsxs("div", { className: "flex items-center", children: [_jsx("button", { onClick: handleLike, className: `flex items-center gap-2 text-sm font-bold transition-colors group ${isLiked ? 'text-blue-500' : 'text-armoyu-text-muted hover:text-blue-500'}`, children: _jsx("div", { className: `p-1.5 rounded-full transition-colors ${isLiked ? 'bg-blue-500/10' : 'group-hover:bg-blue-500/10'}`, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: isLiked ? "currentColor" : "none", stroke: "currentColor", strokeWidth: "2", className: "group-hover:-translate-y-0.5 transition-transform", children: _jsx("path", { d: "M14 9V5a3 3 0 0 0-3-3l-4 9v11h11.28a2 2 0 0 0 2-1.7l1.38-9a2 2 0 0 0-2-2.3zM7 22H4a2 2 0 0 1-2-2v-7a2 2 0 0 1 2-2h3" }) }) }) }), likeCount > 0 && (_jsx("button", { onClick: () => { setInteractionsTab('likes'); setIsInteractionsModalOpen(true); }, className: "text-sm font-black text-armoyu-text-muted hover:text-blue-500 transition-colors ml-1 px-1", children: _jsx(RollingNumber, { value: likeCount }) }))] }), _jsxs("button", { onClick: () => setIsCommentOpen(!isCommentOpen), className: `flex items-center gap-2 text-sm font-bold transition-colors group ${isCommentOpen ? 'text-emerald-500' : 'text-armoyu-text-muted hover:text-emerald-500'}`, title: "Yorum Yap", children: [_jsx("div", { className: `p-1.5 rounded-full transition-colors ${isCommentOpen ? 'bg-emerald-500/10' : 'group-hover:bg-emerald-500/10'}`, children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "group-hover:-translate-y-0.5 transition-transform", children: _jsx("path", { d: "M21 11.5a8.38 8.38 0 0 1-.9 3.8 8.5 8.5 0 0 1-7.6 4.7 8.38 8.38 0 0 1-3.8-.9L3 21l1.9-5.7a8.38 8.38 0 0 1-.9-3.8 8.5 8.5 0 0 1 4.7-7.6 8.38 8.38 0 0 1 3.8-.9h.5a8.48 8.48 0 0 1 8 8v.5z" }) }) }), (stats.comments + commentsList.length + commentsList.reduce((acc, c) => acc + (c.replies?.length || 0), 0)) > 0 &&
|
|
108
|
+
(stats.comments + commentsList.length + commentsList.reduce((acc, c) => acc + (c.replies?.length || 0), 0))] }), _jsxs("div", { className: "flex items-center", children: [_jsx("button", { onClick: () => setIsRepostModalOpen(true), className: "flex items-center gap-2 text-sm font-bold text-armoyu-text-muted hover:text-green-500 transition-colors group", title: "Yeniden Payla\u015F (Retweet)", children: _jsx("div", { className: "p-1.5 rounded-full group-hover:bg-green-500/10 transition-colors", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", className: "group-hover:-translate-y-0.5 transition-transform", children: [_jsx("polyline", { points: "17 1 21 5 17 9" }), _jsx("path", { d: "M3 11V9a4 4 0 0 1 4-4h14" }), _jsx("polyline", { points: "7 23 3 19 7 15" }), _jsx("path", { d: "M21 13v2a4 4 0 0 1-4 4H3" })] }) }) }), stats.reposts && stats.reposts > 0 && (_jsx("button", { onClick: () => { setInteractionsTab('reposts'); setIsInteractionsModalOpen(true); }, className: "text-sm font-black text-armoyu-text-muted hover:text-green-500 transition-colors ml-1 px-1", children: stats.reposts }))] })] }), _jsx("button", { className: "flex items-center gap-2 text-sm font-bold text-armoyu-text-muted hover:text-purple-500 transition-colors group", children: _jsx("div", { className: "p-1.5 rounded-full group-hover:bg-purple-500/10 transition-colors", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", className: "group-hover:-translate-y-0.5 transition-transform", children: [_jsx("circle", { cx: "18", cy: "5", r: "3" }), _jsx("circle", { cx: "6", cy: "12", r: "3" }), _jsx("circle", { cx: "18", cy: "19", r: "3" }), _jsx("line", { x1: "8.59", y1: "13.51", x2: "15.42", y2: "17.49" }), _jsx("line", { x1: "15.41", y1: "6.51", x2: "8.59", y2: "10.49" })] }) }) })] }), isCommentOpen && (_jsxs("div", { className: "bg-black/5 dark:bg-white/5 border-t border-armoyu-card-border p-4 animate-in fade-in slide-in-from-top-2 duration-200", children: [replyingTo && (_jsxs("div", { className: "flex justify-between items-center mb-2.5 px-2", children: [_jsxs("span", { className: "text-xs font-bold text-blue-500 flex items-center gap-1.5", children: [_jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "12", height: "12", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "3", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("polyline", { points: "15 10 20 15 15 20" }), _jsx("path", { d: "M4 4v7a4 4 0 0 0 4 4h12" })] }), _jsx("span", { className: "text-armoyu-text-muted", children: "Yan\u0131tlan\u0131yor:" }), " @", (() => {
|
|
109
|
+
const author = commentsList.find(c => c.id === replyingTo)?.author;
|
|
110
|
+
return typeof author === 'string' ? author : author?.displayName;
|
|
111
|
+
})()] }), _jsx("button", { onClick: () => setReplyingTo(null), className: "text-[11px] font-black uppercase tracking-wider text-armoyu-text-muted hover:text-red-500 transition-colors bg-black/5 dark:bg-white/5 px-2 py-1 rounded-md", children: "\u0130ptal Et" })] })), _jsxs("div", { className: "flex gap-3 mb-2 animate-in fade-in zoom-in-95 duration-300", children: [_jsx("img", { src: user?.avatar || "https://api.dicebear.com/7.x/avataaars/svg?seed=Berkay", alt: "Sen", className: "w-9 h-9 rounded-full bg-white/5 border border-white/10 shrink-0 shadow-sm object-cover" }), _jsxs("div", { className: "flex-1 flex items-center bg-black/5 dark:bg-white/5 border border-gray-200 dark:border-white/10 rounded-2xl px-3 py-1.5 shadow-sm focus-within:border-blue-500 focus-within:ring-1 focus-within:ring-blue-500 transition-all", children: [_jsx("input", { type: "text", value: commentText, onChange: (e) => setCommentText(e.target.value), onKeyDown: (e) => e.key === 'Enter' && handleCommentSubmit(), placeholder: replyingTo ? "Yanıtını yaz..." : "Fikrini paylaş...", className: "flex-1 bg-transparent border-none outline-none text-sm text-armoyu-text placeholder:text-armoyu-text-muted font-medium" }), _jsx("button", { onClick: handleCommentSubmit, disabled: !commentText.trim(), className: "p-2 ml-2 text-blue-500 disabled:text-gray-400 dark:disabled:text-gray-600 disabled:cursor-not-allowed hover:bg-blue-500/10 rounded-xl transition-colors shrink-0", children: _jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2.5", strokeLinecap: "round", strokeLinejoin: "round", children: [_jsx("line", { x1: "22", y1: "2", x2: "11", y2: "13" }), _jsx("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })] }) })] })] }), commentsList.length > 0 && (_jsx("div", { className: "space-y-4 mt-5 px-1", children: commentsList.map((c) => (_jsxs("div", { className: "animate-in fade-in slide-in-from-left-2 zoom-in-95 duration-500", children: [_jsxs("div", { className: "flex gap-3", children: [_jsx("img", { src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${typeof c.author === 'string' ? c.author : c.author?.displayName}`, alt: typeof c.author === 'string' ? c.author : c.author?.displayName, className: "w-8 h-8 rounded-full bg-white/5 border border-black/10 dark:border-white/10 shrink-0 mt-1 shadow-sm" }), _jsxs("div", { className: "flex-1", children: [_jsxs("div", { className: "bg-armoyu-drawer-bg border border-gray-200 dark:border-white/5 rounded-2xl rounded-tl-sm px-4 py-2 shadow-sm inline-block min-w-[30%]", children: [_jsx("div", { className: "text-xs font-black text-armoyu-text mb-0.5", children: typeof c.author === 'string' ? c.author : c.author?.displayName }), _jsx("div", { className: "text-sm font-medium text-armoyu-text-muted", children: c.text || c.content })] }), _jsxs("div", { className: "flex items-center gap-4 mt-1.5 ml-2 text-[11px] font-bold text-armoyu-text-muted", children: [_jsx("span", { className: "hover:text-blue-500 cursor-pointer transition-colors", children: "Be\u011Fen" }), _jsx("span", { onClick: () => { setReplyingTo(c.id); setCommentText(''); }, className: "hover:text-blue-500 cursor-pointer transition-colors", children: "Yan\u0131tla" }), _jsx("span", { className: "opacity-50", children: c.date || c.createdAt })] })] })] }), c.replies && c.replies.length > 0 && (_jsx("div", { className: "mt-3 ml-11 space-y-3 border-l-2 border-black/10 dark:border-white/10 pl-4", children: c.replies.map(r => (_jsxs("div", { className: "flex gap-2.5 animate-in fade-in slide-in-from-left-2 duration-300", children: [_jsx("img", { src: `https://api.dicebear.com/7.x/avataaars/svg?seed=${typeof r.author === 'string' ? r.author : r.author?.displayName}`, alt: typeof r.author === 'string' ? r.author : r.author?.displayName, className: "w-6 h-6 rounded-full bg-white/5 border border-black/10 dark:border-white/10 shrink-0 mt-0.5 shadow-sm relative -left-[27px] ring-4 ring-black/5 dark:ring-[#0a0a0e]/60" }), _jsxs("div", { className: "flex-1 -ml-[18px]", children: [_jsxs("div", { className: "bg-armoyu-drawer-bg border border-gray-200 dark:border-white/5 rounded-2xl rounded-tl-sm px-3.5 py-1.5 shadow-sm inline-block", children: [_jsx("span", { className: "text-xs font-black text-armoyu-text mr-2", children: typeof r.author === 'string' ? r.author : r.author?.displayName }), _jsx("span", { className: "text-[13px] font-medium text-armoyu-text-muted", children: r.text || r.content })] }), _jsxs("div", { className: "flex items-center gap-4 mt-1 ml-2 text-[10px] font-bold text-armoyu-text-muted", children: [_jsx("span", { className: "hover:text-blue-500 cursor-pointer transition-colors", children: "Be\u011Fen" }), _jsx("span", { onClick: () => { setReplyingTo(c.id); setCommentText(''); }, className: "hover:text-blue-500 cursor-pointer transition-colors", children: "Yan\u0131tla" }), _jsx("span", { className: "opacity-50", children: r.date || r.createdAt })] })] })] }, r.id))) }))] }, c.id))) }))] })), _jsx(RepostModal, { isOpen: isRepostModalOpen, onClose: () => setIsRepostModalOpen(false), post: { id, author, content, media, createdAt, stats } }), _jsx(PostInteractionsModal, { isOpen: isInteractionsModalOpen, onClose: () => setIsInteractionsModalOpen(false), title: interactionsTab === 'likes' ? 'Beğenenler' : 'Paylaşanlar', likes: likeList, reposts: repostList, defaultTab: interactionsTab }), lightboxIndex !== null && (_jsx(MediaLightbox, { isOpen: lightboxIndex !== null, onClose: () => setLightboxIndex(null), media: displayMedia, initialIndex: lightboxIndex }))] }));
|
|
112
|
+
}
|
|
113
113
|
//# sourceMappingURL=PostCard.js.map
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { User } from '@armoyu/core';
|
|
2
|
-
interface PostInteractionsModalProps {
|
|
3
|
-
isOpen: boolean;
|
|
4
|
-
onClose: () => void;
|
|
5
|
-
title?: string;
|
|
6
|
-
likes?: User[];
|
|
7
|
-
reposts?: User[];
|
|
8
|
-
defaultTab?: 'likes' | 'reposts';
|
|
9
|
-
}
|
|
10
|
-
export declare function PostInteractionsModal({ isOpen, onClose, title, likes, reposts, defaultTab }: PostInteractionsModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
-
export {};
|
|
1
|
+
import { User } from '@armoyu/core';
|
|
2
|
+
interface PostInteractionsModalProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
title?: string;
|
|
6
|
+
likes?: User[];
|
|
7
|
+
reposts?: User[];
|
|
8
|
+
defaultTab?: 'likes' | 'reposts';
|
|
9
|
+
}
|
|
10
|
+
export declare function PostInteractionsModal({ isOpen, onClose, title, likes, reposts, defaultTab }: PostInteractionsModalProps): import("react/jsx-runtime").JSX.Element | null;
|
|
11
|
+
export {};
|
|
12
12
|
//# sourceMappingURL=PostInteractionsModal.d.ts.map
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { X, Heart, Repeat, User as UserIcon, ChevronRight } from 'lucide-react';
|
|
5
|
-
import Link from 'next/link';
|
|
6
|
-
export function PostInteractionsModal({ isOpen, onClose, title = 'Etkileşimler', likes = [], reposts = [], defaultTab = 'likes' }) {
|
|
7
|
-
const [activeTab, setActiveTab] = React.useState(defaultTab);
|
|
8
|
-
if (!isOpen)
|
|
9
|
-
return null;
|
|
10
|
-
const currentList = activeTab === 'likes' ? likes : reposts;
|
|
11
|
-
return (_jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4 md:p-6", children: [_jsx("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-md animate-in fade-in duration-300", onClick: onClose }), _jsxs("div", { className: "bg-armoyu-card-bg border border-armoyu-card-border rounded-[40px] w-full max-w-md relative z-10 shadow-2xl flex flex-col max-h-[80vh] overflow-hidden animate-in zoom-in-95 duration-300", children: [_jsxs("div", { className: "p-6 border-b border-armoyu-card-border flex items-center justify-between bg-black/5", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "w-10 h-10 rounded-2xl bg-blue-600/10 flex items-center justify-center text-blue-500", children: activeTab === 'likes' ? _jsx(Heart, { size: 20, fill: "currentColor" }) : _jsx(Repeat, { size: 20 }) }), _jsxs("div", { children: [_jsx("h3", { className: "text-lg font-black text-armoyu-text uppercase italic tracking-tighter leading-none", children: title }), _jsxs("p", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest mt-1", children: [currentList.length, " Ki\u015Fi Listeleniyor"] })] })] }), _jsx("button", { onClick: onClose, className: "p-2 text-armoyu-text-muted hover:text-armoyu-text bg-black/10 hover:bg-black/20 rounded-xl transition-all", children: _jsx(X, { size: 20 }) })] }), _jsxs("div", { className: "flex border-b border-armoyu-card-border bg-black/5 px-2", children: [_jsxs("button", { onClick: () => setActiveTab('likes'), className: `flex-1 py-4 text-xs font-black uppercase tracking-widest transition-all relative ${activeTab === 'likes' ? 'text-blue-500' : 'text-armoyu-text-muted hover:text-armoyu-text'}`, children: ["Be\u011Feniler", activeTab === 'likes' && _jsx("div", { className: "absolute bottom-0 left-4 right-4 h-0.5 bg-blue-500 rounded-full" })] }), _jsxs("button", { onClick: () => setActiveTab('reposts'), className: `flex-1 py-4 text-xs font-black uppercase tracking-widest transition-all relative ${activeTab === 'reposts' ? 'text-green-500' : 'text-armoyu-text-muted hover:text-armoyu-text'}`, children: ["Yeniden Payla\u015F\u0131mlar", activeTab === 'reposts' && _jsx("div", { className: "absolute bottom-0 left-4 right-4 h-0.5 bg-green-500 rounded-full" })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto p-4 custom-scrollbar", children: currentList.length > 0 ? (_jsx("div", { className: "space-y-2", children: currentList.map((user, idx) => (_jsxs(Link, { href: user.getProfileUrl(), onClick: onClose, className: "flex items-center gap-4 p-3 rounded-2xl hover:bg-black/5 dark:hover:bg-white/5 transition-all group border border-transparent hover:border-armoyu-card-border", children: [_jsxs("div", { className: "relative shrink-0", children: [_jsx("img", { src: user.avatar, className: "w-11 h-11 rounded-2xl object-cover ring-2 ring-transparent group-hover:ring-blue-500/30 transition-all font-bold", alt: "" }), user.verified && (_jsx("div", { className: "absolute -bottom-1 -right-1 bg-blue-500 text-white p-0.5 rounded-lg border-2 border-armoyu-card-bg shadow-sm", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "8", height: "8", viewBox: "0 0 24 24", fill: "currentColor", children: _jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }) }) }))] }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "text-sm font-black text-armoyu-text uppercase italic tracking-tighter truncate", children: user.displayName }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest leading-none", children: ["@", user.username] })] }), _jsx(ChevronRight, { size: 16, className: "text-armoyu-text-muted opacity-0 group-hover:opacity-100 -translate-x-2 group-hover:translate-x-0 transition-all" })] }, user.id || idx))) })) : (_jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center opacity-40", children: [_jsx("div", { className: "w-16 h-16 rounded-full bg-black/10 flex items-center justify-center mb-4", children: _jsx(UserIcon, { size: 32 }) }), _jsx("h4", { className: "text-sm font-black uppercase italic tracking-widest", children: "Hen\u00FCz Kimse Yok" }), _jsx("p", { className: "text-[10px] font-medium uppercase mt-2", children: "Bu payla\u015F\u0131m hen\u00FCz etkile\u015Fim almam\u0131\u015F." })] })) }), _jsx("div", { className: "p-4 border-t border-armoyu-card-border bg-black/5 text-center", children: _jsx("button", { onClick: onClose, className: "text-[10px] font-black text-armoyu-text-muted hover:text-armoyu-text uppercase tracking-widest transition-all", children: "Kapat" }) })] })] }));
|
|
12
|
-
}
|
|
1
|
+
'use client';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import React from 'react';
|
|
4
|
+
import { X, Heart, Repeat, User as UserIcon, ChevronRight } from 'lucide-react';
|
|
5
|
+
import Link from 'next/link';
|
|
6
|
+
export function PostInteractionsModal({ isOpen, onClose, title = 'Etkileşimler', likes = [], reposts = [], defaultTab = 'likes' }) {
|
|
7
|
+
const [activeTab, setActiveTab] = React.useState(defaultTab);
|
|
8
|
+
if (!isOpen)
|
|
9
|
+
return null;
|
|
10
|
+
const currentList = activeTab === 'likes' ? likes : reposts;
|
|
11
|
+
return (_jsxs("div", { className: "fixed inset-0 z-[100] flex items-center justify-center p-4 md:p-6", children: [_jsx("div", { className: "absolute inset-0 bg-black/60 backdrop-blur-md animate-in fade-in duration-300", onClick: onClose }), _jsxs("div", { className: "bg-armoyu-card-bg border border-armoyu-card-border rounded-[40px] w-full max-w-md relative z-10 shadow-2xl flex flex-col max-h-[80vh] overflow-hidden animate-in zoom-in-95 duration-300", children: [_jsxs("div", { className: "p-6 border-b border-armoyu-card-border flex items-center justify-between bg-black/5", children: [_jsxs("div", { className: "flex items-center gap-3", children: [_jsx("div", { className: "w-10 h-10 rounded-2xl bg-blue-600/10 flex items-center justify-center text-blue-500", children: activeTab === 'likes' ? _jsx(Heart, { size: 20, fill: "currentColor" }) : _jsx(Repeat, { size: 20 }) }), _jsxs("div", { children: [_jsx("h3", { className: "text-lg font-black text-armoyu-text uppercase italic tracking-tighter leading-none", children: title }), _jsxs("p", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest mt-1", children: [currentList.length, " Ki\u015Fi Listeleniyor"] })] })] }), _jsx("button", { onClick: onClose, className: "p-2 text-armoyu-text-muted hover:text-armoyu-text bg-black/10 hover:bg-black/20 rounded-xl transition-all", children: _jsx(X, { size: 20 }) })] }), _jsxs("div", { className: "flex border-b border-armoyu-card-border bg-black/5 px-2", children: [_jsxs("button", { onClick: () => setActiveTab('likes'), className: `flex-1 py-4 text-xs font-black uppercase tracking-widest transition-all relative ${activeTab === 'likes' ? 'text-blue-500' : 'text-armoyu-text-muted hover:text-armoyu-text'}`, children: ["Be\u011Feniler", activeTab === 'likes' && _jsx("div", { className: "absolute bottom-0 left-4 right-4 h-0.5 bg-blue-500 rounded-full" })] }), _jsxs("button", { onClick: () => setActiveTab('reposts'), className: `flex-1 py-4 text-xs font-black uppercase tracking-widest transition-all relative ${activeTab === 'reposts' ? 'text-green-500' : 'text-armoyu-text-muted hover:text-armoyu-text'}`, children: ["Yeniden Payla\u015F\u0131mlar", activeTab === 'reposts' && _jsx("div", { className: "absolute bottom-0 left-4 right-4 h-0.5 bg-green-500 rounded-full" })] })] }), _jsx("div", { className: "flex-1 overflow-y-auto p-4 custom-scrollbar", children: currentList.length > 0 ? (_jsx("div", { className: "space-y-2", children: currentList.map((user, idx) => (_jsxs(Link, { href: user.getProfileUrl(), onClick: onClose, className: "flex items-center gap-4 p-3 rounded-2xl hover:bg-black/5 dark:hover:bg-white/5 transition-all group border border-transparent hover:border-armoyu-card-border", children: [_jsxs("div", { className: "relative shrink-0", children: [_jsx("img", { src: user.avatar, className: "w-11 h-11 rounded-2xl object-cover ring-2 ring-transparent group-hover:ring-blue-500/30 transition-all font-bold", alt: "" }), user.verified && (_jsx("div", { className: "absolute -bottom-1 -right-1 bg-blue-500 text-white p-0.5 rounded-lg border-2 border-armoyu-card-bg shadow-sm", children: _jsx("svg", { xmlns: "http://www.w3.org/2000/svg", width: "8", height: "8", viewBox: "0 0 24 24", fill: "currentColor", children: _jsx("path", { d: "M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z" }) }) }))] }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("div", { className: "text-sm font-black text-armoyu-text uppercase italic tracking-tighter truncate", children: user.displayName }), _jsxs("div", { className: "text-[10px] font-bold text-armoyu-text-muted uppercase tracking-widest leading-none", children: ["@", user.username] })] }), _jsx(ChevronRight, { size: 16, className: "text-armoyu-text-muted opacity-0 group-hover:opacity-100 -translate-x-2 group-hover:translate-x-0 transition-all" })] }, user.id || idx))) })) : (_jsxs("div", { className: "flex flex-col items-center justify-center py-12 text-center opacity-40", children: [_jsx("div", { className: "w-16 h-16 rounded-full bg-black/10 flex items-center justify-center mb-4", children: _jsx(UserIcon, { size: 32 }) }), _jsx("h4", { className: "text-sm font-black uppercase italic tracking-widest", children: "Hen\u00FCz Kimse Yok" }), _jsx("p", { className: "text-[10px] font-medium uppercase mt-2", children: "Bu payla\u015F\u0131m hen\u00FCz etkile\u015Fim almam\u0131\u015F." })] })) }), _jsx("div", { className: "p-4 border-t border-armoyu-card-border bg-black/5 text-center", children: _jsx("button", { onClick: onClose, className: "text-[10px] font-black text-armoyu-text-muted hover:text-armoyu-text uppercase tracking-widest transition-all", children: "Kapat" }) })] })] }));
|
|
12
|
+
}
|
|
13
13
|
//# sourceMappingURL=PostInteractionsModal.js.map
|