diff --git a/app/[locale]/institute/administration/(committees)/board-of-governors/page.tsx b/app/[locale]/institute/administration/(committees)/board-of-governors/page.tsx index 2f027545..c9ce16d4 100644 --- a/app/[locale]/institute/administration/(committees)/board-of-governors/page.tsx +++ b/app/[locale]/institute/administration/(committees)/board-of-governors/page.tsx @@ -5,7 +5,7 @@ export default async function BoardOfGovernors({ searchParams, }: { params: { locale: string }; - searchParams: { meetingPage?: string }; + searchParams: { page?: string }; }) { return ( diff --git a/app/[locale]/institute/administration/(committees)/building-and-work-committee/page.tsx b/app/[locale]/institute/administration/(committees)/building-and-work-committee/page.tsx index 2a77e4f0..c094558a 100644 --- a/app/[locale]/institute/administration/(committees)/building-and-work-committee/page.tsx +++ b/app/[locale]/institute/administration/(committees)/building-and-work-committee/page.tsx @@ -5,7 +5,7 @@ export default function BuildingAndWorkCommittee({ searchParams, }: { params: { locale: string }; - searchParams: { meetingPage?: string }; + searchParams: { page?: string }; }) { return ( diff --git a/app/[locale]/institute/administration/(committees)/committee.tsx b/app/[locale]/institute/administration/(committees)/committee.tsx index 62f846a4..94b890a8 100644 --- a/app/[locale]/institute/administration/(committees)/committee.tsx +++ b/app/[locale]/institute/administration/(committees)/committee.tsx @@ -25,14 +25,14 @@ export default async function Committee({ type, }: { locale: string; - searchParams: { meetingPage?: string }; + searchParams: { page?: string }; type: (typeof committeeMembers.committeeType.enumValues)[number]; }) { const text = (await getTranslations(locale)).Committee; - const meetingPage = isNaN(Number(searchParams.meetingPage ?? '1')) + const meetingPage = isNaN(Number(searchParams.page ?? '1')) ? 1 - : Math.max(Number(searchParams.meetingPage ?? '1'), 1); + : Math.max(Number(searchParams.page ?? '1'), 1); return (
diff --git a/app/[locale]/institute/administration/(committees)/financial-committee/page.tsx b/app/[locale]/institute/administration/(committees)/financial-committee/page.tsx index d92b90e9..662d01bb 100644 --- a/app/[locale]/institute/administration/(committees)/financial-committee/page.tsx +++ b/app/[locale]/institute/administration/(committees)/financial-committee/page.tsx @@ -5,7 +5,7 @@ export default function FinancialCommittee({ searchParams, }: { params: { locale: string }; - searchParams: { meetingPage?: string }; + searchParams: { page?: string }; }) { return ( diff --git a/app/[locale]/institute/administration/(committees)/senate/page.tsx b/app/[locale]/institute/administration/(committees)/senate/page.tsx index 899c06a7..cae998ae 100644 --- a/app/[locale]/institute/administration/(committees)/senate/page.tsx +++ b/app/[locale]/institute/administration/(committees)/senate/page.tsx @@ -7,7 +7,7 @@ export default async function Senate({ searchParams, }: { params: { locale: string }; - searchParams: { meetingPage?: string }; + searchParams: { page?: string }; }) { return ( <> diff --git a/app/[locale]/research/patents-and-technologies/page.tsx b/app/[locale]/research/patents-and-technologies/page.tsx new file mode 100644 index 00000000..30018446 --- /dev/null +++ b/app/[locale]/research/patents-and-technologies/page.tsx @@ -0,0 +1,201 @@ +import { Suspense } from 'react'; + +import Loading from '~/components/loading'; +import ImageHeader from '~/components/image-header'; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from '~/components/ui'; +import { PaginationWithLogic } from '~/components/pagination/pagination'; +import { getTranslations } from '~/i18n/translations'; + +export default async function PatentsAndTechnology({ + params: { locale }, + searchParams, +}: { + params: { locale: string }; + searchParams?: { page?: string }; +}) { + const currentPage = Number(searchParams?.page ?? 1); + + const text = (await getTranslations(locale)).PatentsAndTechnologies; + + // Static patent data + const staticPatents = [ + { + applicationNumber: '2269/DEL/2012', + patentNumber: '320045', + title: 'Intelligent induction hardening device and method thereof', + inventors: [ + { + facultyId: 'jitender_kumar_chhabra_1', + name: 'Jitender Kumar Chhabra', + }, + ], + }, + { + applicationNumber: '2269/DEL/2012', + patentNumber: '320045', + title: + 'Method of preventing radioactive gas to diffuse indoor environment by forming concrete with shielding effect', + inventors: [ + { + facultyId: 'jitender_kumar_chhabra_2', + name: 'Jitender Kumar Chhabra', + }, + ], + }, + { + applicationNumber: '2269/DEL/2012', + patentNumber: '320045', + title: 'System for extracting water from atmospheric air', + inventors: [ + { + facultyId: 'jitender_kumar_chhabra_3', + name: 'Jitender Kumar Chhabra', + }, + ], + }, + { + applicationNumber: '2269/DEL/2012', + patentNumber: '320045', + title: 'System for extracting water from atmospheric air', + inventors: [ + { + facultyId: 'jitender_kumar_chhabra_4', + name: 'Jitender Kumar Chhabra', + }, + ], + }, + { + applicationNumber: '3001/DEL/2013', + patentNumber: '320046', + title: 'Advanced solar energy harvesting system', + inventors: [ + { + facultyId: 'jitender_kumar_chhabra_5', + name: 'Jitender Kumar Chhabra', + }, + ], + }, + { + applicationNumber: '3002/DEL/2013', + patentNumber: '320047', + title: 'Automated waste management and recycling apparatus', + inventors: [ + { + facultyId: 'jitender_kumar_chhabra_6', + name: 'Jitender Kumar Chhabra', + }, + ], + }, + ]; + + // Get the total count for pagination + const getPatentCount = async () => { + const count = staticPatents.length; // Replace with your actual DB call + return [{ count }]; + }; + + return ( + <> + +
+
+ + + + {[ + text.number, + text.applicationNumber, + text.patentNumber, + text.techTitle, + text.inventor, + ].map((headerText, index) => ( + {headerText} + ))} + + + + + + + + + } + > + + + +
+
+ +
+ +
+
+ + ); +} + +const PatentTable = ({ + tableData, + currentPage, + itemsPerPage = 10, +}: { + tableData: { + applicationNumber: string; + patentNumber: string; + title: string; + inventors: { + facultyId: string; + name: string; + }[]; + }[]; + currentPage: number; + itemsPerPage?: number; +}) => { + const startIndex = (currentPage - 1) * itemsPerPage; + const visibleData = tableData.slice(startIndex, startIndex + itemsPerPage); + + return ( + <> + {visibleData.map((item, index) => { + const cellData = [ + startIndex + index + 1, + item.applicationNumber, + item.patentNumber, + item.title, + item.inventors.map((inventor) => inventor.name).join(', '), + ]; + + return ( + + {cellData.map((cellContent, cellIndex) => ( + {cellContent} + ))} + + ); + })} + + ); +}; diff --git a/components/pagination/pagination.tsx b/components/pagination/pagination.tsx index 55bfe0f6..fac5f89b 100644 --- a/components/pagination/pagination.tsx +++ b/components/pagination/pagination.tsx @@ -28,13 +28,13 @@ export const PaginationWithLogic = async ({ 1 @@ -43,7 +43,7 @@ export const PaginationWithLogic = async ({ {noOfPages > 1 && (currentPage < 4 || noOfPages < 6) && ( 2 @@ -53,7 +53,7 @@ export const PaginationWithLogic = async ({ {noOfPages > 2 && (currentPage < 4 || noOfPages < 6) && ( 3 @@ -66,7 +66,7 @@ export const PaginationWithLogic = async ({ <> {currentPage} @@ -79,7 +79,7 @@ export const PaginationWithLogic = async ({ {noOfPages > 5 && currentPage > noOfPages - 3 && ( {noOfPages - 2} @@ -89,7 +89,7 @@ export const PaginationWithLogic = async ({ {noOfPages > 4 && (currentPage > noOfPages - 3 || noOfPages < 6) && ( {noOfPages - 1} @@ -99,7 +99,7 @@ export const PaginationWithLogic = async ({ {noOfPages > 3 && ( {noOfPages} @@ -110,7 +110,7 @@ export const PaginationWithLogic = async ({ = noOfPages} - href={{ query: { meetingPage: currentPage + 1 } }} + href={{ query: { page: currentPage + 1 } }} /> diff --git a/i18n/en.ts b/i18n/en.ts index 4e0179a6..1224eefb 100644 --- a/i18n/en.ts +++ b/i18n/en.ts @@ -455,6 +455,15 @@ Saturdays & Holidays: 09.00 am to 05.00 pm`, description: 'Not Acceptable Please try again', }, }, + PatentsAndTechnologies: { + title: 'PATENTS & TECHNOLOGIES', + number: 'Serial No.', + applicationNumber: 'Application No.', + patentNumber: 'Patent No.', + techTitle: 'Technology / Invention Title', + inventor: 'Inventor', + }, + StudentActivities: { title: 'STUDENT ACTIVITIES', headings: { diff --git a/i18n/hi.ts b/i18n/hi.ts index 78c2a811..7bde31ca 100644 --- a/i18n/hi.ts +++ b/i18n/hi.ts @@ -453,6 +453,14 @@ const text: Translations = { description: 'अस्वीकार्य दुबारा प्रयास करें।', }, }, + PatentsAndTechnologies: { + title: 'पेटेंट और प्रौद्योगिकी', + number: 'संख्या', + applicationNumber: 'आवेदन संख्या', + patentNumber: 'पेटेंट संख्या', + techTitle: 'प्रौद्योगिकी / आविष्कार शीर्षक', + inventor: 'आविष्कारक', + }, StudentActivities: { title: 'छात्र गतिविधियाँ', headings: { diff --git a/i18n/translations.ts b/i18n/translations.ts index 4d5b5ac4..1832f03d 100644 --- a/i18n/translations.ts +++ b/i18n/translations.ts @@ -368,6 +368,14 @@ export interface Translations { WorkInProgress: { title: string; description: string }; NotAcceptable: { title: string; description: string }; }; + PatentsAndTechnologies: { + title: string; + number: string; + applicationNumber: string; + patentNumber: string; + techTitle: string; + inventor: string; + }; StudentActivities: { title: string; headings: {