continue: add violation panel
This commit is contained in:
@@ -9,6 +9,43 @@ import ViolationPageActions from '@/app/ui/violations/file-page/violation-page-a
|
||||
import ViolationPageViolationsList from '@/app/ui/violations/file-page/violation-page-violations-list';
|
||||
import ViolationPageNote from '@/app/ui/violations/file-page/violation-page-note';
|
||||
import { getFileViolations } from '@/app/actions/violationActions';
|
||||
import { viewFileInfo } from '@/app/actions/fileEntity';
|
||||
import { useTranslations } from 'next-intl';
|
||||
import ViolationFileNotFound from '@/app/ui/violations/file-page/violation-file-not-found';
|
||||
|
||||
type MonitoringStatus = 'NONE' | 'MONITORING_DAILY' | 'MONITORING_WEEKLY' | 'MONITORING_MONTHLY';
|
||||
type MimeType = 'image' | 'video' | 'audio' | 'document';
|
||||
|
||||
export interface FileDetails {
|
||||
id: string;
|
||||
userId: number;
|
||||
originalFileName: string;
|
||||
storedFileName: string;
|
||||
filePath: string;
|
||||
protectedFilePath: string;
|
||||
fileSize: number;
|
||||
mimeType: MimeType;
|
||||
fileExtension: string;
|
||||
checksum: string;
|
||||
uploadSessionId: string;
|
||||
status: string;
|
||||
createdAt: string;
|
||||
updatedAt: string;
|
||||
formattedSize: string;
|
||||
downloadUrl: string;
|
||||
existsOnDisk: boolean;
|
||||
supportId: number | null;
|
||||
protectStatus: string;
|
||||
ownerName: string;
|
||||
ownerEmail: string;
|
||||
ownerCompany: string | null;
|
||||
fileName: string;
|
||||
fileFormat: string | null;
|
||||
checksCount: number;
|
||||
fileUploadDate: string;
|
||||
monitoring: MonitoringStatus;
|
||||
thumbnailFileUrl: string;
|
||||
}
|
||||
|
||||
interface PageProps {
|
||||
params: Promise<{ id: string }>;
|
||||
@@ -19,31 +56,43 @@ export default async function Page({
|
||||
params,
|
||||
searchParams
|
||||
}: PageProps) {
|
||||
/* const t = useTranslations('Global'); */
|
||||
const { id } = await params;
|
||||
const { page } = await searchParams;
|
||||
const currentPage = Number(page) || 1;
|
||||
|
||||
const fileViolations = await getFileViolations(id, currentPage);
|
||||
try {
|
||||
const fileViolations = await getFileViolations(id, currentPage);
|
||||
const fileInfo: FileDetails = await viewFileInfo(id);
|
||||
|
||||
return (
|
||||
<div className="violation-details">
|
||||
<ViolationPageTitle />
|
||||
<div className="grid grid-cols-[2fr_1fr] gap-3">
|
||||
return (
|
||||
<div className="violation-details">
|
||||
<ViolationPageTitle fileInfo={fileInfo} />
|
||||
<div>
|
||||
<ViolationPageViolationInfo />
|
||||
<ViolationPageViolationsList
|
||||
fileViolations={fileViolations}
|
||||
currentPage={currentPage}
|
||||
fileId={id}
|
||||
/>
|
||||
<ViolationPageNote />
|
||||
</div>
|
||||
<div>
|
||||
<ViolationPpageFileStatistic />
|
||||
<ViolationPageFileInfo />
|
||||
<ViolationPageActions />
|
||||
<div
|
||||
className="grid grid-cols-[2fr_1fr] gap-3"
|
||||
>
|
||||
<ViolationPageFileInfo fileInfo={fileInfo} />
|
||||
{/* <ViolationPageActions /> */}
|
||||
<ViolationPpageFileStatistic />
|
||||
</div>
|
||||
<div>
|
||||
<ViolationPageViolationsList
|
||||
fileViolations={fileViolations}
|
||||
currentPage={currentPage}
|
||||
fileId={id}
|
||||
/>
|
||||
{/* <ViolationPageNote /> */}
|
||||
{/* <ViolationPageViolationInfo /> */}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
)
|
||||
} catch (error) {
|
||||
|
||||
return (
|
||||
<ViolationFileNotFound />
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user