application page
This commit is contained in:
38
src/app/(admin)/(others-pages)/profile/applications/page.tsx
Normal file
38
src/app/(admin)/(others-pages)/profile/applications/page.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
"use client";
|
||||
import { useSelector } from "react-redux";
|
||||
import { RootState } from "@/store/store";
|
||||
import { SafeHTMLRenderer } from "@/components/ui/parse/SafeHTMLRenderer";
|
||||
|
||||
export default function ApplicationDetailPage() {
|
||||
const application = useSelector((state: RootState) => state.user.selectedApplication);
|
||||
|
||||
if (!application) {
|
||||
return <div className="p-10 text-center">Đang tải hoặc không có dữ liệu...</div>;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="p-6 bg-white dark:bg-gray-900 rounded-xl shadow">
|
||||
<h2 className="text-2xl font-bold mb-6 border-b pb-2">Chi tiết Application</h2>
|
||||
|
||||
<div className="space-y-6">
|
||||
<div>
|
||||
<label className="text-sm font-semibold text-gray-400 uppercase">Loại yêu cầu:</label>
|
||||
<p className="text-lg font-medium">{application.verify_type}</p>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label className="text-sm font-semibold text-gray-400 uppercase mb-3 block">
|
||||
Nội dung hiển thị (CV):
|
||||
</label>
|
||||
|
||||
{/* SỬ DỤNG Ở ĐÂY */}
|
||||
<div className="border border-gray-100 rounded-lg p-2 bg-gray-50">
|
||||
<SafeHTMLRenderer html={application.content} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{/* Các phần khác như Media... */}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
@@ -1,18 +1,20 @@
|
||||
"use client";
|
||||
|
||||
import AccountDetails from "@/components/user-profile/AccountDetails";
|
||||
import ApplicationList from "@/components/user-profile/ApplicationList";
|
||||
import MediaCard from "@/components/user-profile/Media";
|
||||
import UserInfoCard from "@/components/user-profile/UserInfoCard";
|
||||
import UserMetaCard from "@/components/user-profile/UserMetaCard";
|
||||
import { MediaDto } from "@/interface/media";
|
||||
import { UserMetaCardProps } from "@/interface/user";
|
||||
import { apiGetCurrentUser } from "@/service/auth";
|
||||
import { apiGetCurrentUserMedia } from "@/service/userService";
|
||||
import { apiGetCurrentUserApplications, apiGetCurrentUserMedia } from "@/service/userService";
|
||||
import { useEffect, useState } from "react";
|
||||
|
||||
export default function Profile() {
|
||||
const [user, setUser] = useState<UserMetaCardProps | null>(null);
|
||||
const [mediaData, setMediaData] = useState<MediaDto | null>(null);
|
||||
const [applications, setApplications] = useState<any[]>([]);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -20,6 +22,12 @@ export default function Profile() {
|
||||
try {
|
||||
const userData = await apiGetCurrentUser();
|
||||
const mediaResponse = await apiGetCurrentUserMedia();
|
||||
const userApplications = await apiGetCurrentUserApplications();
|
||||
// console.log("User Applications:", userApplications);
|
||||
|
||||
if (userApplications?.data) {
|
||||
setApplications(userApplications.data);
|
||||
}
|
||||
|
||||
setMediaData(mediaResponse);
|
||||
setUser(userData);
|
||||
@@ -42,6 +50,7 @@ export default function Profile() {
|
||||
<UserMetaCard data={user ?? {}} />
|
||||
<UserInfoCard data={{ ...user, openEdit: true }} />
|
||||
{(mediaData?.data?.length ?? 0) > 0 && <MediaCard data={mediaData ?? {}} />}
|
||||
<ApplicationList applications={applications} />
|
||||
<AccountDetails data={user ?? {}} />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user