diff --git a/public/oc/HarishChandra.webp b/public/oc/HarishChandra.webp new file mode 100644 index 0000000..d323d7d Binary files /dev/null and b/public/oc/HarishChandra.webp differ diff --git a/src/app/admin/papers/page.tsx b/src/app/admin/papers/page.tsx index fd1cea8..659c573 100644 --- a/src/app/admin/papers/page.tsx +++ b/src/app/admin/papers/page.tsx @@ -8,172 +8,215 @@ import { useState, useEffect } from 'react' // import {sendReviewDecisionMail} from '@/lib/mail' interface Paper { - id: string - submissionId: string - title: string - author: string - theme: string - status: 'submitted' | 'under_review' | 'accepted' | 'rejected' - submissionDate: string - fileUrl: string - trackType: string + id: string + submissionId: string + title: string + author: string + authorEmail: string // Added author email field + coAuthors?: string[] // Added co-authors field + theme: string + status: 'submitted' | 'under_review' | 'accepted' | 'rejected' + submissionDate: string + fileUrl: string + trackType: string } export default function PapersPage() { - const [papers, setPapers] = useState([]) - const [loading, setLoading] = useState(true) - const [error, setError] = useState(null) - const [filterTheme, setFilterTheme] = useState('all') - const [themes, setThemes] = useState<(Theme | 'all')[]>(['all']) + const [papers, setPapers] = useState([]) + const [loading, setLoading] = useState(true) + const [error, setError] = useState(null) + const [filterTheme, setFilterTheme] = useState('all') + const [themes, setThemes] = useState<(Theme | 'all')[]>(['all']) - useEffect(() => { - const fetchPapers = async () => { - setLoading(true) - setError(null) - try { - const response = await fetch('/api/papers') - const result = await response.json() - if (!result.success) throw new Error(result.data) - setPapers(result.data.map((p: any) => ({ - id: p.id, - submissionId: p.submissionId, - title: p.title, - author: p.author?.name || '', - theme: p.theme?.name || '', - status: p.status, - fileUrl: p.fileUrl, - trackType: p.trackType, - submissionDate: p.submittedAt ? new Date(p.submittedAt).toISOString().slice(0, 10) : '' - }))) - } catch (err) { - setError(err instanceof Error ? err.message : 'Failed to fetch papers') - } finally { - setLoading(false) - } - } + useEffect(() => { + const fetchPapers = async () => { + setLoading(true) + setError(null) + try { + const response = await fetch('/api/papers') + const result = await response.json() + if (!result.success) throw new Error(result.data) + setPapers(result.data.map((p: any) => ({ + id: p.id, + submissionId: p.submissionId, + title: p.title, + author: p.author?.name || '', + authorEmail: p.author?.email || '', // Map author email + coAuthors: p.coAuthors || [], // Map co-authors + theme: p.theme?.name || '', + status: p.status, + fileUrl: p.fileUrl, + trackType: p.trackType, + submissionDate: p.submittedAt ? new Date(p.submittedAt).toISOString().slice(0, 10) : '' + }))) + } catch (err) { + setError(err instanceof Error ? err.message : 'Failed to fetch papers') + } finally { + setLoading(false) + } + } - const fetchThemes = async () => { - const res = await getThemes(); - const data = res.data - setThemes(['all', ...data.data]); - } + const fetchThemes = async () => { + const res = await getThemes(); + const data = res.data + setThemes(['all', ...data.data]); + } - fetchPapers() - fetchThemes() - }, []) + fetchPapers() + fetchThemes() + }, []) - const updatePaperStatus = async (id: string, newStatus: Paper['status']) => { - setPapers(prev => - prev.map(paper => - paper.id === id ? { ...paper, status: newStatus } : paper - ) - ) - await fetch('/api/papers/' + id, { - method: 'PATCH', - body: JSON.stringify({ status: newStatus }) - }) - } + const updatePaperStatus = async (id: string, newStatus: Paper['status']) => { + try { + // Find the paper before updating + const paperToUpdate = papers.find(paper => paper.id === id); + if (!paperToUpdate) return; - const filteredPapers = filterTheme === 'all' - ? papers - : papers.filter(paper => paper.theme === filterTheme) + // Update local state first + setPapers(prev => + prev.map(paper => + paper.id === id ? { ...paper, status: newStatus } : paper + ) + ) - return ( -
-
-

Papers Management

+ // Send API request to update status + await fetch('/api/papers/' + id, { + method: 'PATCH', + body: JSON.stringify({ status: newStatus }) + }) - {/* Theme Filter */} -
- - -
-
- {loading ? ( -
Loading...
- ) : error ? ( -
{error}
- ) : ( -
- - - - - - - - - - - - - - {filteredPapers.map((paper) => ( - - - - - - - - - + + + + + ))} + +
- Submission ID - - Title - - Author - - Theme - - Track Type - - Submission Date - - Actions -
- {paper.submissionId} - -
{paper.title}
-
- {paper.author} - - {paper.theme} - - {paper.trackType} - - {paper.submissionDate} - - - + // Send appropriate email based on status + // if (newStatus === 'accepted') { + // await sendReviewDecisionMail(sendReviewArrivalMailParams{ + // to: paperToUpdate.authorEmail, + // paperTitle: paperToUpdate.title, + // firstName: paperToUpdate.author.split(' ')[0], + // coAuthors: paperToUpdate.coAuthors, + // status: 'accepted' + // }) + // } else if (newStatus === 'rejected') { + // await sendReviewDecisionMail(sendReviewArrivalMailParams{ + // to: paperToUpdate.authorEmail, + // paperTitle: paperToUpdate.title, + // firstName: paperToUpdate.author.split(' ')[0], + // coAuthors: paperToUpdate.coAuthors, + // status: 'rebuttal' + // }) + // } + } catch (error) { + console.error('Error updating paper status:', error) + // Revert local state if there was an error + setPapers(prev => + prev.map(paper => + paper.id === id ? { ...paper, status: paper.status } : paper + ) + ) + } + } + + const filteredPapers = filterTheme === 'all' + ? papers + : papers.filter(paper => paper.theme === filterTheme) + + return ( +
+
+

Papers Management

+ + {/* Theme Filter */} +
+ + +
+
+ {loading ? ( +
Loading...
+ ) : error ? ( +
{error}
+ ) : ( +
+ + + + + + + + + + + + + + + {filteredPapers.map((paper) => ( + + + + + - - ))} - -
+ Submission ID + + Title + + Author + + Theme + + Track Type + + Submission Date + + Status + + Actions +
+ {paper.submissionId} + +
{paper.title}
+
+ {paper.author} + + {paper.theme}
-
- )} -
- ) +
+ {paper.trackType} + + {paper.submissionDate} + + {paper.status.replace('_', ' ')} + + +
+
+ )} +
+ ) } - diff --git a/src/app/committee/page.tsx b/src/app/committee/page.tsx index 8e3c862..26c3f7f 100644 --- a/src/app/committee/page.tsx +++ b/src/app/committee/page.tsx @@ -1,671 +1,688 @@ import Image from "next/image"; export default function CommitteePage() { - return ( -
-
-

- Organizing Committee -

-
-

- Meet the dedicated team behind the National Conference on Computer - Innovations (NCCI) 2025. -

-
+ return ( +
+
+

+ Organizing Committee +

+
+

+ Meet the dedicated team behind the National Conference on Computer + Innovations (NCCI) 2025. +

+
- {/* Organizing Committee */} -
+ {/* Organizing Committee */} +
- {/* Conference Chair */} -
-

- Conference Chair -

-
-
-
- Dr. Bal Krishna Bal -
-

Dr. Bal Krishna Bal

-

Professor

-

Associate Dean, School of Engineering

-

Kathmandu University

-
-
+ {/* Conference Chair */} +
+

+ Conference Chair +

+
+
+
+ Dr. Bal Krishna Bal +
+

Dr. Bal Krishna Bal

+

Professor

+

Associate Dean, School of Engineering

+

Kathmandu University

+
+
- {/* Advisory Board */} -
-

- Advisory Board -

-
-
-
-
- Dr. Sudan Jha -
-

Dr. Sudan Jha

-

Professor and Lead Researcher

-

Department of Computer Science and Engineering

-

Kathmandu University, Nepal

-
-
-
- Dr. Sushil Shrestha -
-

Dr. Sushil Shrestha

-

Associate Professor

-

Lead, Digital Learning Research Lab

-

Kathmandu University

-
-
+ {/* Advisory Board */} +
+

+ Advisory Board +

+
+
+
+
+ Dr. Sudan Jha +
+

Dr. Sudan Jha

+

Professor and Lead Researcher

+

Department of Computer Science and Engineering

+

Kathmandu University, Nepal

+
+
+
+ Dr. Sushil Shrestha +
+

Dr. Sushil Shrestha

+

Associate Professor

+

Lead, Digital Learning Research Lab

+

Kathmandu University

+
+
- {/* Publication Chair */} -

- Publication Chair -

-
-
-
- Gajendra Sharma, PhD. -
-

Gajendra Sharma, PhD.

-

Professor of Computer Engineering

-

Department of Computer Science and Engineering, Kathmandu University

-
-
+ {/* Publication Chair */} +

+ Publication Chair +

+
+
+
+ Gajendra Sharma, PhD. +
+

Gajendra Sharma, PhD.

+

Professor of Computer Engineering

+

Department of Computer Science and Engineering, Kathmandu University

+
+
- {/* Convener */} -
-

- Convener -

-
-
-
- Er. Pankaj Raj Dawadi, PhD. -
-

Er. Pankaj Raj Dawadi, PhD.

-

Assistant Professor

-

Acting Head Of Department

-

DoCSE, Kathmandu University

-
-
-
+ {/* Convener */} +
+

+ Convener +

+
+
+
+ Er. Pankaj Raj Dawadi, PhD. +
+

Er. Pankaj Raj Dawadi, PhD.

+

Assistant Professor

+

Acting Head Of Department

+

DoCSE, Kathmandu University

+
+
+
- {/* Technical Program Committee */} -
-

- Technical Program Committee -

-
- {/* First Row */} -
-
-
- Dr. Bikash Nakarmi -
-

Dr. Bikash Nakarmi

-

Professor

-

College of Electronic and Information Engineering

-

NUAA, China

-
-
-
- Dr. Basanta Joshi -
-

Dr. Basanta Joshi

-

Assistant Professor

-

Department of Electronics and Computer Engineering

-

Pulchowk Campus

-
-
-
- Aman Shakya, PhD -
-

Aman Shakya, PhD

-

Assistant Professor

-

Department of Electronics and Computer Engineering

-

Pulchowk Campus

-
-
-
- Dr. Manoj Shakya -
-

Dr. Manoj Shakya

-

Assistant Professor

-

Department of Computer Science and Engineering

-

Kathmandu University

-
-
-
- Dr. Prakash Poudyal -
-

Dr. Prakash Poudyal

-

Assistant Professor

-

Researcher, ILPRL

-

Kathmandu University

-
-
-
- Dhiraj Shrestha -
-

Dhiraj Shrestha

-

Assistant Professor

-

Department of Computer Science and Engineering

-

Kathmandu University

-
-
-
- Sushil Nepal -
-

Sushil Nepal

-

Assistant Professor

-

Department of Computer Science and Engineering

-

Kathmandu University

-
-
-
- Nabin Ghimire -
-

Nabin Ghimire

-

Assistant Professor

-

Department of Computer Science and Engineering

-

Kathmandu University

-
-
-
- Trailokya Raj Ojha -
-

Trailokya Raj Ojha

-

Assistant Professor

-

Department of Computer Science and Engineering

-

Kathmandu University

-
-
-
- Amrit Dahal -
-

Amrit Dahal

-

Lecturer

-

Department of Computer Science and Engineering

-

Kathmandu University

-
-
-
- Suman Shrestha -
-

Suman Shrestha

-

Lecturer

-

Department of Computer Science and Engineering

-

Kathmandu University

-
-
-
- Subhadra Joshi -
-

Subhadra Joshi

-

Lecturer

-

Department of Computer Science and Engineering

-

Kathmandu University

-
-
+ {/* Technical Program Committee */} +
+

+ Technical Program Committee +

+
+ {/* First Row */} +
+
+
+ Dr. Bikash Nakarmi +
+

Dr. Bikash Nakarmi

+

Professor

+

College of Electronic and Information Engineering

+

NUAA, China

+
+
+
+ Dr. Basanta Joshi +
+

Dr. Basanta Joshi

+

Assistant Professor

+

Department of Electronics and Computer Engineering

+

Pulchowk Campus

+
+
+
+ Aman Shakya, PhD +
+

Aman Shakya, PhD

+

Assistant Professor

+

Department of Electronics and Computer Engineering

+

Pulchowk Campus

+
+
+
+ Dr. Manoj Shakya +
+

Dr. Manoj Shakya

+

Assistant Professor

+

Department of Computer Science and Engineering

+

Kathmandu University

+
+
+
+ Dr. Prakash Poudyal +
+

Dr. Prakash Poudyal

+

Assistant Professor

+

Researcher, ILPRL

+

Kathmandu University

+
+
+
+ Dhiraj Shrestha +
+

Dhiraj Shrestha

+

Assistant Professor

+

Department of Computer Science and Engineering

+

Kathmandu University

+
+
+
+ Sushil Nepal +
+

Sushil Nepal

+

Assistant Professor

+

Department of Computer Science and Engineering

+

Kathmandu University

+
+
+
+ Nabin Ghimire +
+

Nabin Ghimire

+

Assistant Professor

+

Department of Computer Science and Engineering

+

Kathmandu University

+
+
+
+ Trailokya Raj Ojha +
+

Trailokya Raj Ojha

+

Assistant Professor

+

Department of Computer Science and Engineering

+

Kathmandu University

+
+
+
+ Amrit Dahal +
+

Amrit Dahal

+

Lecturer

+

Department of Computer Science and Engineering

+

Kathmandu University

+
+
+
+ Suman Shrestha +
+

Suman Shrestha

+

Lecturer

+

Department of Computer Science and Engineering

+

Kathmandu University

+
+
+
+ Subhadra Joshi +
+

Subhadra Joshi

+

Lecturer

+

Department of Computer Science and Engineering

+

Kathmandu University

+
+
+
+
+ Harish Chandra Bhandari +
+

Harish Chandra Bhandari, PhD

+

Lecturer

+

Department of Computer Science and Engineering

+

Kathmandu University

+
+
- {/* Technical Coordinator */} -
-

- Technical Coordinator -

-
-
-
- Sanjog Sigdel -
-

Sanjog Sigdel

-

Lecturer, DoCSE

-

Kathmandu University

-
-
-
- {/* Conference Coordinator */} -
-

- Conference Coordinator -

-
-
-
- -
-

Abhiyan Dhakal

-

Student

-

KU, DoCSE

-
-
-
+ {/* Technical Coordinator */} +
+

+ Technical Coordinator +

+
+
+
+ Sanjog Sigdel +
+

Sanjog Sigdel

+

Lecturer, DoCSE

+

Kathmandu University

+
+
+
- {/* Conference Secretary */} -
-

- Conference Secretary -

-
-
-
- Mukul Aryal -
-

Mukul Aryal

-

Student

-

KU, DoCSE

-
-
-
+ {/* Conference Coordinator */} +
+

+ Conference Coordinator +

+
+
+
+ +
+

Abhiyan Dhakal

+

Student

+

KU, DoCSE

+
+
+
- {/* Conference Treasurer */} -
-

- Conference Treasurer -

-
-
-
- Suyog Ghimire -
-

Suyog Ghimire

-

Student

-

KU, DoCSE

-
-
-
-
+ {/* Conference Secretary */} +
+

+ Conference Secretary +

+
+
+
+ Mukul Aryal +
+

Mukul Aryal

+

Student

+

KU, DoCSE

+
+
+
-
-

- Web Development Committee -

-
- {[ - { - name: "Ashwini Subedi", - position: "Committee Head", - affiliation: "KU, DoCSE", - image: "/oc/Ashwini.webp" - }, - { - name: "Shreejan Prasad Karmacharya", - position: "Member", - affiliation: "KU, DoCSE", - image: "/oc/ShreejanKarmacharya.webp" - }, - { - name: "Shriharsh Sharma Acharya", - position: "Member", - affiliation: "KU, DoCSE", - image: "/oc/Shriharsh.webp" - }, - ].map((member, index) => ( -
-
- {member.name} -
-

{member.name}

-

{member.position}

-

{member.affiliation}

-
- ))} -
-
-
-

- Logistics Committee -

-
- {[ - { - name: "Saroj Sigdel", - position: "Student", - affiliation: "KU, DoCSE", - image: "/oc/SarojSigdel.webp" - }, - ].map((member, index) => ( -
-
- {member.name} -
-

{member.name}

-

{member.position}

-

{member.affiliation}

-
- ))} -
-
+ {/* Conference Treasurer */} +
+

+ Conference Treasurer +

+
+
+
+ Suyog Ghimire +
+

Suyog Ghimire

+

Student

+

KU, DoCSE

+
+
+
+
-
-

- Design Committee -

-
- {[ - { - name: "Avipsa Hamo", - position: "Committee Head", - affiliation: "Student, KU DoCSE", - image: "/oc/AvipsaHamo.webp" - }, - { - name: "Sakshi KC", - position: "Member", - affiliation: "Student, KU DoCSE", - image: "/oc/SakshiKC.webp" - }, - { - name: "Prabal Shakya", - position: "Member", - affiliation: "Student, KU DoCSE", - image: "/oc/PrabalShakya.webp" - }, - { - name: "Subhechha Karki", - position: "Member", - affiliation: "Student, KU DoCSE", - image: "/oc/SubhechhaKarki.webp" - }, - { - name: "Shubham Sharma", - position: "Member", - affiliation: "Student, KU DoCSE", - image: "/oc/ShubhamSharma.webp" - }, - ].map((member, index) => ( -
-
- {member.name} -
-

{member.name}

-

{member.position}

-

{member.affiliation}

-
- ))} -
-
-
-

- Digital Marketing Committee -

-
- {[ - { - name: "Aakriti Pandey", - position: "Committee Head", - affiliation: "Student, KU DoCSE", - image: "/oc/AakritiPandey.webp" - }, - { - name: "Aatmiyata Pokhrel", - position: "Member", - affiliation: "Student, KU DoCSE", - image: "/oc/AatmiyataPokhrel.webp" - }, - ].map((member, index) => ( -
-
- {member.name} -
-

{member.name}

-

{member.position}

-

{member.affiliation}

-
- ))} -
-
+
+

+ Web Development Committee +

+
+ {[ + { + name: "Ashwini Subedi", + position: "Committee Head", + affiliation: "KU, DoCSE", + image: "/oc/Ashwini.webp" + }, + { + name: "Shreejan Prasad Karmacharya", + position: "Member", + affiliation: "KU, DoCSE", + image: "/oc/ShreejanKarmacharya.webp" + }, + { + name: "Shriharsh Sharma Acharya", + position: "Member", + affiliation: "KU, DoCSE", + image: "/oc/Shriharsh.webp" + }, + ].map((member, index) => ( +
+
+ {member.name} +
+

{member.name}

+

{member.position}

+

{member.affiliation}

+
+ ))} +
+
+
+

+ Logistics Committee +

+
+ {[ + { + name: "Saroj Sigdel", + position: "Student", + affiliation: "KU, DoCSE", + image: "/oc/SarojSigdel.webp" + }, + ].map((member, index) => ( +
+
+ {member.name} +
+

{member.name}

+

{member.position}

+

{member.affiliation}

+
+ ))} +
+
-
-

- Physical Marketing Committee -

-
- {[ - { - name: "Kiran Dahal", - position: "Committee Head", - affiliation: "Student, KU DoCSE", - image: "/oc/KiranDahal.webp" - }, - { - name: "Abhinav Bhatt", - position: "Member", - affiliation: "Student, KU DoCSE", - image: "/oc/AbhinavBhatt.webp" - }, - { - name: "Sameer singh", - position: "Member", - affiliation: "Student, KU DoCSE", - image: "/oc/SameerSingh.webp" - }, - { - name: "Poshan karki", - position: "Member", - affiliation: "Student, KU DoCSE", - image: "/oc/Poshankarki.webp" - }, - ].map((member, index) => ( -
-
- {member.name} -
-

{member.name}

-

{member.position}

-

{member.affiliation}

-
- ))} -
-
-
-

- Sponsorship Committee -

-
- {[ - { - name: "Lawan Poudyal", - position: "Committee Head", - affiliation: "Student, KU DoCSE", - image: "/oc/LawanPoudyal.webp" - }, - { - name: "Bishist Bikram Pant", - position: "Member", - affiliation: "Student, KU DoCSE", - image: "/oc/BishistBPant.webp" - }, - { - name: "Nischal Subedi", - position: "Member", - affiliation: "Student, KU DoCSE", - image: "/oc/NischalSubedi.webp" - }, - ].map((member, index) => ( -
-
- {member.name} -
-

{member.name}

-

{member.position}

-

{member.affiliation}

-
- ))} -
-
+
+

+ Design Committee +

+
+ {[ + { + name: "Avipsa Hamo", + position: "Committee Head", + affiliation: "Student, KU DoCSE", + image: "/oc/AvipsaHamo.webp" + }, + { + name: "Sakshi KC", + position: "Member", + affiliation: "Student, KU DoCSE", + image: "/oc/SakshiKC.webp" + }, + { + name: "Prabal Shakya", + position: "Member", + affiliation: "Student, KU DoCSE", + image: "/oc/PrabalShakya.webp" + }, + { + name: "Subhechha Karki", + position: "Member", + affiliation: "Student, KU DoCSE", + image: "/oc/SubhechhaKarki.webp" + }, + { + name: "Shubham Sharma", + position: "Member", + affiliation: "Student, KU DoCSE", + image: "/oc/ShubhamSharma.webp" + }, + ].map((member, index) => ( +
+
+ {member.name} +
+

{member.name}

+

{member.position}

+

{member.affiliation}

+
+ ))} +
+
+
+

+ Digital Marketing Committee +

+
+ {[ + { + name: "Aakriti Pandey", + position: "Committee Head", + affiliation: "Student, KU DoCSE", + image: "/oc/AakritiPandey.webp" + }, + { + name: "Aatmiyata Pokhrel", + position: "Member", + affiliation: "Student, KU DoCSE", + image: "/oc/AatmiyataPokhrel.webp" + }, + ].map((member, index) => ( +
+
+ {member.name} +
+

{member.name}

+

{member.position}

+

{member.affiliation}

+
+ ))} +
+
-
-
-
-
+
+

+ Physical Marketing Committee +

+
+ {[ + { + name: "Kiran Dahal", + position: "Committee Head", + affiliation: "Student, KU DoCSE", + image: "/oc/KiranDahal.webp" + }, + { + name: "Abhinav Bhatt", + position: "Member", + affiliation: "Student, KU DoCSE", + image: "/oc/AbhinavBhatt.webp" + }, + { + name: "Sameer singh", + position: "Member", + affiliation: "Student, KU DoCSE", + image: "/oc/SameerSingh.webp" + }, + { + name: "Poshan karki", + position: "Member", + affiliation: "Student, KU DoCSE", + image: "/oc/Poshankarki.webp" + }, + ].map((member, index) => ( +
+
+ {member.name} +
+

{member.name}

+

{member.position}

+

{member.affiliation}

+
+ ))} +
+
+
+

+ Sponsorship Committee +

+
+ {[ + { + name: "Lawan Poudyal", + position: "Committee Head", + affiliation: "Student, KU DoCSE", + image: "/oc/LawanPoudyal.webp" + }, + { + name: "Bishist Bikram Pant", + position: "Member", + affiliation: "Student, KU DoCSE", + image: "/oc/BishistBPant.webp" + }, + { + name: "Nischal Subedi", + position: "Member", + affiliation: "Student, KU DoCSE", + image: "/oc/NischalSubedi.webp" + }, + ].map((member, index) => ( +
+
+ {member.name} +
+

{member.name}

+

{member.position}

+

{member.affiliation}

+
+ ))} +
+
+ +
+
+
+ ); } diff --git a/src/lib/mail.ts b/src/lib/mail.ts index 5e78d17..54b2d53 100644 --- a/src/lib/mail.ts +++ b/src/lib/mail.ts @@ -23,7 +23,7 @@ interface sendReviewArrivalMailParams{ to: string paperTitle: string firstName: string - coAuthors: string[] | null + coAuthors: string[] | undefined status: string paperReview: string }