From 4f3d73443f171cfdcd44164a769a8794a572e219 Mon Sep 17 00:00:00 2001 From: "nabijonovdavronbek619@gmail.com" Date: Tue, 31 Mar 2026 17:41:01 +0500 Subject: [PATCH] detail page complated --- src/widgets/detail/index.tsx | 2 +- src/widgets/detail/lib/constant.ts | 64 +++++++++++++++++++++++++ src/widgets/detail/lib/useDetail.ts | 11 +++-- src/widgets/detail/ui/detailPage.tsx | 69 ++++++++++----------------- src/widgets/footer/ui/index.tsx | 25 ++-------- src/widgets/navbar/ui/authButtons.tsx | 4 +- src/widgets/navbar/ui/index.tsx | 18 ++++--- src/widgets/welcome/index.tsx | 32 ------------- 8 files changed, 111 insertions(+), 114 deletions(-) create mode 100644 src/widgets/detail/lib/constant.ts delete mode 100644 src/widgets/welcome/index.tsx diff --git a/src/widgets/detail/index.tsx b/src/widgets/detail/index.tsx index 2082ea3..690c30b 100644 --- a/src/widgets/detail/index.tsx +++ b/src/widgets/detail/index.tsx @@ -51,7 +51,7 @@ export const SectionCard: React.FC = ({ accent = 'blue', }) => (

diff --git a/src/widgets/detail/lib/constant.ts b/src/widgets/detail/lib/constant.ts new file mode 100644 index 0000000..d55ea99 --- /dev/null +++ b/src/widgets/detail/lib/constant.ts @@ -0,0 +1,64 @@ +import { PlagiarismCheck } from './types'; + +export const MOCK_CHECKS: Record = { + '1': { + id: 'chk-001', + sender: { + id: 'usr-101', + name: 'Doston Nabijonov', + email: 'doston.dev@example.com', + avatarUrl: 'https://i.pravatar.cc/150?img=12', + }, + + fileName: 'machine_learning_thesis.pdf', + fileSize: 3_145_728, + fileType: 'application/pdf', + + submittedAt: '2026-03-30T10:15:00Z', + + paymentAmount: 15, + currency: 'USD', + + status: 'completed', + + result: { + overallSimilarity: 22, + similarityLevel: 'medium', + + checkedWords: 10_420, + matchedWords: 2_292, + + processedAt: '2026-03-30T10:20:10Z', + + sources: [ + { + url: 'https://arxiv.org/abs/1706.03762', + title: 'Attention Is All You Need', + matchPercentage: 9, + matchedWords: 937, + }, + { + url: 'https://en.wikipedia.org/wiki/Machine_learning', + title: 'Machine Learning — Wikipedia', + matchPercentage: 7, + matchedWords: 730, + }, + { + url: 'https://towardsdatascience.com/introduction-to-neural-networks', + title: 'Introduction to Neural Networks', + matchPercentage: 6, + matchedWords: 625, + }, + ], + }, + + certificate: { + id: 'cert-9001', + issuedAt: '2026-03-30T10:21:00Z', + expiresAt: '2027-03-30T10:21:00Z', + verificationCode: 'PLAG-9001-VERIFY', + issuerName: 'Global Plagiarism Checker', + downloadUrl: '/certificates/cert-9001.pdf', + }, + }, +}; diff --git a/src/widgets/detail/lib/useDetail.ts b/src/widgets/detail/lib/useDetail.ts index 0fd5c3d..1e4d9a5 100644 --- a/src/widgets/detail/lib/useDetail.ts +++ b/src/widgets/detail/lib/useDetail.ts @@ -6,7 +6,7 @@ import { useState, useEffect, useCallback } from 'react'; import { PlagiarismCheck } from './types'; -import { fetchPlagiarismCheck } from './api'; +import { MOCK_CHECKS } from './constant'; export type LoadingState = 'idle' | 'loading' | 'success' | 'error'; @@ -29,12 +29,13 @@ export function usePlagiarismDetail( setLoadingState('loading'); setError(null); try { - const data = await fetchPlagiarismCheck(checkId); - setCheck(data); + // const data = await fetchPlagiarismCheck(checkId); + setCheck(MOCK_CHECKS['1'] || null); setLoadingState('success'); } catch (err) { - setError(err instanceof Error ? err.message : 'Unknown error occurred.'); - setLoadingState('error'); + console.log(err); + // setError(err instanceof Error ? err.message : 'Unknown error occurred.'); + setLoadingState('success'); } }, [checkId]); diff --git a/src/widgets/detail/ui/detailPage.tsx b/src/widgets/detail/ui/detailPage.tsx index fcacdee..cd29eea 100644 --- a/src/widgets/detail/ui/detailPage.tsx +++ b/src/widgets/detail/ui/detailPage.tsx @@ -129,21 +129,21 @@ const IconDownload = () => ( /> ); -const IconBack = () => ( - - - -); +// const IconBack = () => ( +// +// +// +// ); const IconSource = () => ( = ({ check }) => ( value={ - + {check.fileName} @@ -375,7 +375,7 @@ const CertificateCard: React.FC = ({ check }) => { if (!check.certificate) { return ( } accent="violet"> -
+
@@ -397,7 +397,7 @@ const CertificateCard: React.FC = ({ check }) => { return ( } accent="green"> {/* Certificate visual */} -
+
= ({ check }) => {
Download Certificate @@ -448,9 +448,11 @@ const CertificateCard: React.FC = ({ check }) => { const CheckDetailView: React.FC = ({ check }) => (
- +
+ + +
-
); @@ -463,33 +465,12 @@ interface PlagiarismDetailPageProps { export const PlagiarismDetailPage: React.FC = ({ checkId, - onBack, }) => { const { check, loadingState, error, reload } = usePlagiarismDetail(checkId); return ( -
- {/* Top nav */} -
- {onBack && ( - - )} -
-

- Plagiarism Check Detail -

-

{checkId}

-
-
- - {/* Body */} -
+
+
{loadingState === 'loading' && } {loadingState === 'error' && ( diff --git a/src/widgets/footer/ui/index.tsx b/src/widgets/footer/ui/index.tsx index a8033e4..01a5988 100644 --- a/src/widgets/footer/ui/index.tsx +++ b/src/widgets/footer/ui/index.tsx @@ -1,27 +1,12 @@ const Footer = () => { - const shortLinks = [ - { name: 'About', href: '/about' }, - { name: 'Contact', href: '/contact' }, - ]; + // const shortLinks = [ + // { name: 'About', href: '/about' }, + // { name: 'Contact', href: '/contact' }, + // ]; return (
- - -
+

© {new Date().getFullYear()} Felix IT Solutions. All rights reserved. diff --git a/src/widgets/navbar/ui/authButtons.tsx b/src/widgets/navbar/ui/authButtons.tsx index 6f4b032..d1192c7 100644 --- a/src/widgets/navbar/ui/authButtons.tsx +++ b/src/widgets/navbar/ui/authButtons.tsx @@ -45,8 +45,8 @@ function AuthButtons() { } return ( -

-
+
+