last push
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
'use client';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { blue } from '../../lib/constant';
|
||||
import { PlagiatData } from '../../lib/types';
|
||||
import BarRow from './BarRow';
|
||||
@@ -14,27 +16,28 @@ export default function GaugeWithBars({
|
||||
originalityPercent,
|
||||
citationPercent,
|
||||
}: Props) {
|
||||
const t = useTranslations('PlagiatResult');
|
||||
return (
|
||||
<div className="flex items-center gap-5 mb-5">
|
||||
<CircleGauge value={plagiarismPercent || 0} />
|
||||
<div className="flex-1">
|
||||
<BarRow
|
||||
label="Plagiat"
|
||||
label={t('plagiat')}
|
||||
value={plagiarismPercent || 0}
|
||||
color={blue[900]}
|
||||
/>
|
||||
<BarRow
|
||||
label="AI generatsiya"
|
||||
label={t('aiGeneration')}
|
||||
value={aiPercent || 0}
|
||||
color={blue[600]}
|
||||
/>
|
||||
<BarRow
|
||||
label="Original"
|
||||
label={t('original')}
|
||||
value={originalityPercent || 0}
|
||||
color={blue[400]}
|
||||
/>
|
||||
<BarRow
|
||||
label="Iqtibos"
|
||||
label={t('citation')}
|
||||
value={citationPercent || 0}
|
||||
color={blue[200]}
|
||||
/>
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use client';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { blue } from '../../lib/constant';
|
||||
import { PlagiatData } from '../../lib/types';
|
||||
|
||||
@@ -21,6 +23,7 @@ export default function Header({
|
||||
location,
|
||||
checkedAt,
|
||||
}: Props) {
|
||||
const t = useTranslations('PlagiatResult');
|
||||
return (
|
||||
<div className="flex items-center gap-3 mb-5">
|
||||
<div
|
||||
@@ -41,7 +44,7 @@ export default function Header({
|
||||
className="text-xs px-2.5 py-0.5 rounded-md font-medium"
|
||||
style={{ background: blue[100], color: blue[800] }}
|
||||
>
|
||||
{plagiarismPercent}% plagiat
|
||||
{plagiarismPercent}% {t('plagiat').toLowerCase()}
|
||||
</span>
|
||||
</div>
|
||||
<p className="text-[13px] mt-0.5 truncate" style={{ color: blue[400] }}>
|
||||
@@ -50,7 +53,7 @@ export default function Header({
|
||||
</div>
|
||||
<div className="text-right shrink-0">
|
||||
<p className="text-[11px]" style={{ color: blue[400] }}>
|
||||
Tekshirilgan
|
||||
{t('checked')}
|
||||
</p>
|
||||
<p className="text-[12px] mt-0.5" style={{ color: blue[600] }}>
|
||||
{checkedAt}
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
'use client';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import { PlagiatData } from '../../lib/types';
|
||||
import MetricCard from './Metriccard';
|
||||
|
||||
@@ -12,12 +14,16 @@ export default function TopMetrics({
|
||||
originalityPercent,
|
||||
citationPercent,
|
||||
}: Props) {
|
||||
const t = useTranslations('PlagiatResult');
|
||||
return (
|
||||
<div className="grid grid-cols-4 gap-2.5 mb-5">
|
||||
<MetricCard label="Plagiat darajasi" value={`${plagiarismPercent}%`} />
|
||||
<MetricCard label="AI yozgan" value={`${aiPercent}%`} />
|
||||
<MetricCard label="Originallik" value={`${originalityPercent}%`} />
|
||||
<MetricCard label="Iqtibos" value={`${citationPercent}%`} />
|
||||
<MetricCard
|
||||
label={t('plagiarismLevel')}
|
||||
value={`${plagiarismPercent}%`}
|
||||
/>
|
||||
<MetricCard label={t('aiWritten')} value={`${aiPercent}%`} />
|
||||
<MetricCard label={t('originality')} value={`${originalityPercent}%`} />
|
||||
<MetricCard label={t('citation')} value={`${citationPercent}%`} />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -145,26 +145,6 @@ function Skeleton() {
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Error state ──────────────────────────────────────────────────────────────
|
||||
|
||||
function ErrorState() {
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center p-6 bg-slate-50">
|
||||
<div
|
||||
className="rounded-xl p-8 text-center"
|
||||
style={{ background: '#fff', border: `0.5px solid ${blue[100]}` }}
|
||||
>
|
||||
<p className="text-sm font-medium mb-1" style={{ color: blue[900] }}>
|
||||
Ma'lumot topilmadi
|
||||
</p>
|
||||
<p className="text-xs" style={{ color: blue[400] }}>
|
||||
Ushbu tekshiruv mavjud emas yoki o'chirilgan
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
// ─── Component ────────────────────────────────────────────────────────────────
|
||||
|
||||
export default function PlagiatResult({ id }: { id: number }) {
|
||||
@@ -186,7 +166,22 @@ export default function PlagiatResult({ id }: { id: number }) {
|
||||
});
|
||||
|
||||
if (isLoading) return <Skeleton />;
|
||||
if (isError || !rawData) return <ErrorState />;
|
||||
if (isError || !rawData)
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center p-6 bg-slate-50">
|
||||
<div
|
||||
className="rounded-xl p-8 text-center"
|
||||
style={{ background: '#fff', border: `0.5px solid ${blue[100]}` }}
|
||||
>
|
||||
<p className="text-sm font-medium mb-1" style={{ color: blue[900] }}>
|
||||
Ma'lumot topilmadi
|
||||
</p>
|
||||
<p className="text-xs" style={{ color: blue[400] }}>
|
||||
Ushbu tekshiruv mavjud emas yoki o'chirilgan
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
const data: PlagiatData = transformResponse(rawData);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user