{/* Header */}
-
-
+
Certificates
View and download internship certificates
-
- {/* Content */}
-
- {data.isReceived ? (
-
- ) : (
-
- )}
+
+ {/* Kiri: Content */}
+
+ {data.isReceived ? (
+
+ ) : (
+
+ )}
+
+ {/* Kanan: History */}
+
+
+
);
};
-
-export default SertificatePage
+export default SertificatePage;
diff --git a/src/Pages/internify/intern/TaskSubmission.tsx b/src/Pages/internify/intern/TaskSubmission.tsx
index 5268b26..737e25f 100644
--- a/src/Pages/internify/intern/TaskSubmission.tsx
+++ b/src/Pages/internify/intern/TaskSubmission.tsx
@@ -1,23 +1,27 @@
-import { useState } from "react";
-import { useParams, useNavigate } from "react-router-dom";
-import { ChevronRight, Calendar, FileText, Info } from "lucide-react";
+import { useParams, useSearchParams } from "react-router-dom";
+import { FileText, Info } from "lucide-react";
import TaskFormFile from "./components/TaskForm-file";
import TaskFormLink from "./components/TaskForm-link";
+import { mockProjects } from "../../../lib/mockProjects";
+
+const toSlug = (name: string) => name.toLowerCase().replace(/\s+/g, '-');
export default function TaskSubmission() {
- const { id } = useParams<{ id: string }>();
- const navigate = useNavigate();
-
- // State untuk menentukan jenis input ("file" atau "link")
- const [submissionType, setSubmissionType] = useState<"file" | "link">("file");
+ const [searchParams] = useSearchParams();
+ const { slug, taskSlug } = useParams<{ slug: string; taskSlug: string }>();
- const handleFileSubmit = (file: File) => {
- console.log(`Submitting File for Task ${id}:`, file.name);
- alert(`File ${file.name} berhasil dikirim!`);
+ const submissionType = (searchParams.get("type") ?? "file") as "file" | "link";
+
+ const project = mockProjects.find((p) => toSlug(p.name) === slug);
+ const task = project?.tasks.find((t) => toSlug(t.title) === taskSlug);
+ const handleFileSubmit = (files: File[]) => {
+ const fileNames = files.map(f => f.name).join(', ');
+ console.log(`Submitting Files for Project ${slug}:`, fileNames);
+ alert(`File ${fileNames} berhasil dikirim!`);
};
const handleLinkSubmit = (link: string) => {
- console.log(`Submitting Link for Task ${id}:`, link);
+ console.log(`Submitting Link for Project ${slug}:`, link);
alert(`Link berhasil dikirim!`);
};
@@ -27,28 +31,17 @@ export default function TaskSubmission() {
-
Laporan Tugas 2
-
-
- Due Oct 25, 2024 at 23:59
-
-
-
- {/* Switcher Demo Sederhana (Bisa kamu hapus jika tipe datang dari database/routing) */}
-
-
-
+
+ {task?.title ?? "Submit Task"}
+
+
+
+ {submissionType === "file" ? "📄 File Upload" : "🔗 Link Submission"}
+
@@ -56,9 +49,7 @@ export default function TaskSubmission() {
Task Description
- Pada tugas pertama ini, Anda diminta untuk melakukan analisis mendalam terhadap kebutuhan pengguna
- untuk sistem "Smart Campus Utility". Analisis ini akan menjadi fondasi bagi perancangan antarmuka pada
- fase berikutnya.
+ {task?.description ?? "Kerjakan dan kirimkan tugas sesuai dengan instruksi yang diberikan."}
@@ -69,11 +60,11 @@ export default function TaskSubmission() {
Submit Task
- {/* Render Komponen secara Kondisional */}
+ {/* Render form sesuai tipe dari query param */}
{submissionType === "file" ? (
-
+
) : (
-
+
)}
{/* Info Box */}
diff --git a/src/Pages/internify/intern/components/CertificateAvailabe.tsx b/src/Pages/internify/intern/components/CertificateAvailabe.tsx
index 040921a..983f4c3 100644
--- a/src/Pages/internify/intern/components/CertificateAvailabe.tsx
+++ b/src/Pages/internify/intern/components/CertificateAvailabe.tsx
@@ -1,10 +1,10 @@
import { useState } from "react";
-import { Download, History , Link, Award, Printer } from "lucide-react";
-import { type CertificateData, type CertificateHistory } from "../../../../lib/mockData";
+import { Download, Link, Printer } from "lucide-react";
+import { type CertificateData } from "../../../../lib/mockSertificates";
import certificateImg from "../../../../assets/certificate.png";
export default function CertificateAvailable({ data }: { data: CertificateData }) {
- const { certificate, history } = data;
+ const { certificate } = data;
const [copied, setCopied] = useState(false);
const handleCopyLink = () => {
@@ -14,11 +14,9 @@ export default function CertificateAvailable({ data }: { data: CertificateData }
};
return (
-
- {/* LEFT: Certificate Preview + Actions */}
-
- {/* Certificate Card */}
-
+
+ {/* Certificate Card */}
+

{/* Unduh Sertifikat */}
-
-
-
- {/* RIGHT: Certificate History */}
-
-
-
-
-
Certificate History
-
-
-
- {history.map((item: CertificateHistory) => (
-
-
-

-
-
-
{item.month}
-
{item.title}
-
- Grade: {item.grade}
-
-
-
- ))}
-
-
-
-
- See more
-
-
-
-
);
}
\ No newline at end of file
diff --git a/src/Pages/internify/intern/components/CertificateHistory.tsx b/src/Pages/internify/intern/components/CertificateHistory.tsx
new file mode 100644
index 0000000..0f0048d
--- /dev/null
+++ b/src/Pages/internify/intern/components/CertificateHistory.tsx
@@ -0,0 +1,47 @@
+import { useNavigate } from "react-router-dom";
+import { History } from "lucide-react";
+import { type CertificateHistory, history as certificateHistory } from "../../../../lib/mockSertificates";
+import certificateImg from "../../../../assets/certificate.png";
+
+export default function SertificateHistory() {
+ const navigate = useNavigate();
+ return (
+
+
+
+
Certificate History
+
+
+
+ {certificateHistory.slice(0, 2).map((item: CertificateHistory) => (
+
+
+

+
+
+
{item.month}
+
{item.title}
+
Grade: {item.grade}
+
+
+ ))}
+
+
+
+ navigate('/intern/certificates/all')}
+ className="text-sm text-red-700 font-semibold hover:underline"
+ >
+ See more
+
+
+
+ );
+}
\ No newline at end of file
diff --git a/src/Pages/internify/intern/components/CertificateNotAvailable.tsx b/src/Pages/internify/intern/components/CertificateNotAvailable.tsx
index 24e15ad..685590d 100644
--- a/src/Pages/internify/intern/components/CertificateNotAvailable.tsx
+++ b/src/Pages/internify/intern/components/CertificateNotAvailable.tsx
@@ -2,33 +2,33 @@ import { Lock, Clock } from "lucide-react";
export default function CertificateNotAvailable({ progress, remainingTasks }: { progress: number; remainingTasks: number }) {
return (
-
+
{/* Icon */}
-
-
Sertifikat Belum Tersedia
-
- Anda harus menyelesaikan semua tugas proyek sebelum dapat mengunduh sertifikat kelulusan.
+
Sertifikat Belum Tersedia
+
+ Anda harus menyelesaikan semua tugas proyek sebelum dapat mengunduh sertifikat kelulusan.
Silakan periksa kembali progres tugas Anda di menu Proyek.
{/* Progress Bar */}
-
+
Progres Proyek
{progress}%
-
+
name.toLowerCase().replace(/\s+/g, '-');
const HomeProjectList = () => {
const navigate = useNavigate();
@@ -11,14 +13,12 @@ const HomeProjectList = () => {
return (
navigate(`/intern/projects/${project.id}`)}
+ onClick={() => navigate(`/intern/projects/${toSlug(project.name)}`)}
className="flex items-center gap-4 border border-gray-200 rounded-lg px-4 py-3 hover:bg-gray-50 cursor-pointer transition-colors duration-150"
>
-
-
+
{project.name}
- {/*
{project.role}
*/}
)
diff --git a/src/Pages/internify/intern/components/ProjectTaskCard.tsx b/src/Pages/internify/intern/components/ProjectTaskCard.tsx
index b611fd9..56a6bf6 100644
--- a/src/Pages/internify/intern/components/ProjectTaskCard.tsx
+++ b/src/Pages/internify/intern/components/ProjectTaskCard.tsx
@@ -1,11 +1,14 @@
-import type { Task } from "../../../../lib/mockData";
+import type { Task } from "../../../../lib/mockProjects";
import { useNavigate } from "react-router-dom";
const formatDate = (date: Date) =>
new Date(date).toLocaleDateString('id-ID', { day: 'numeric', month: 'short', year: 'numeric' });
-export default function TaskCard({ task }: { task: Task }) {
+const toSlug = (name: string) => name.toLowerCase().replace(/\s+/g, '-');
+
+export default function TaskCard({ task, projectName }: { task: Task; projectName: string }) {
const navigate = useNavigate();
+ const toTaskSlug = (title: string) => title.toLowerCase().replace(/\s+/g, '-');
return (
@@ -18,6 +21,9 @@ export default function TaskCard({ task }: { task: Task }) {
{task.description}
+
+ Tipe Submission : {task.type === 'file' ? "File" : "Link"}
+
@@ -26,11 +32,11 @@ export default function TaskCard({ task }: { task: Task }) {
DONE
) : (
- navigate(`/intern/tasks/${task.id}/submit`)}>
+ navigate(`/intern/projects/${toSlug(projectName)}/${toTaskSlug(task.title)}?type=${task.type}`)}>
Add Submission
)}
);
-}
\ No newline at end of file
+}
diff --git a/src/Pages/internify/intern/components/ProjectsCard.tsx b/src/Pages/internify/intern/components/ProjectsCard.tsx
index d183433..21228e6 100644
--- a/src/Pages/internify/intern/components/ProjectsCard.tsx
+++ b/src/Pages/internify/intern/components/ProjectsCard.tsx
@@ -1,5 +1,7 @@
import { useNavigate } from 'react-router-dom'
+const toSlug = (name: string) => name.toLowerCase().replace(/\s+/g, '-');
+
interface ProjectCardProps {
id: number | string
name: string
@@ -12,7 +14,6 @@ interface ProjectCardProps {
}
const ProjectCard = ({
- id,
name,
mentor,
avatarUrl,
@@ -65,7 +66,7 @@ const ProjectCard = ({
{/* Button */}
navigate(`/intern/projects/${id}`)}
+ onClick={() => navigate(`/intern/projects/${toSlug(name)}`)}
className="bg-red-600 hover:bg-red-700 text-white text-xs font-medium py-1.5 px-3 rounded-xl transition-colors"
>
View Project
diff --git a/src/Pages/internify/intern/components/SidebarIntern.tsx b/src/Pages/internify/intern/components/SidebarIntern.tsx
index abd95d2..a7a148b 100644
--- a/src/Pages/internify/intern/components/SidebarIntern.tsx
+++ b/src/Pages/internify/intern/components/SidebarIntern.tsx
@@ -30,14 +30,9 @@ export default function SidebarIntern({ isOpen, closeSidebar }: SidebarProps) {
return (