-
{statusLabels[registration.status] ?? registration.status}
- {rawDate ?
• {formatJalali(rawDate)} : null}
+
+
+
+
{registration.event.title}
+
+ {statusLabels[registration.status] ?? registration.status}
+ {rawDate ? • {formatJalali(rawDate)} : null}
+
+
);
};
- const renderRegistrationGroup = ({
- title,
- description,
- items,
- icon: Icon,
- badgeVariant,
- }: {
- title: string;
- description: string;
- items: Types.MyEventRegistrationSchema[];
- icon: React.ComponentType<{ className?: string }>;
- badgeVariant: "default" | "secondary" | "destructive";
- }) => (
-
-
-
-
-
-
-
- {formatNumberPersian(items.length)}
- {title}
-
-
{description}
-
-
-
- {items.length > 0 ? (
- items.map(renderRegistrationRow)
- ) : (
-
- موردی در این بخش ثبت نشده است.
-
- )}
-
-
+ const renderPostRow = (post: Types.PostListSchema) => (
+
+
+ {post.title}
+
+
{post.excerpt || "بدون خلاصه"}
+
+ );
+
+ const renderCommentRow = (comment: Types.CommentSchema) => (
+
+
+ {comment.post_title}
+
+
{comment.content}
+
{formatJalali(comment.created_at, false)}
+
);
if (!loading && !isAuthenticated) {
@@ -423,29 +439,14 @@ export default function Profile() {
);
}
- const helmet = (
-
- {pageTitle}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- );
-
return (
<>
- {helmet}
+
+ {pageTitle}
+
+
+
+
{(loading || fetching) && !me ? (
@@ -455,188 +456,61 @@ export default function Profile() {
) : editing ? (
-
-
-
+
+
+
ویرایش پروفایل
-
- اطلاعات شخصی و دانشگاهی خود را با دقت بهروزرسانی کنید.
-
-
-
-
-
+ اطلاعات شخصی و دانشگاهی خود را بهروزرسانی کنید.
+
-
-
-
-
{me?.username}
-
{me?.email}
-
-
-
-
- {avatarFallback}
-
- {uploading ? (
-
-
-
- ) : null}
-
-
-
-
-
-
+
+ {renderAvatarControl("h-28 w-28")}