add complain registration, add view complaint inforation, add status change for marches when user click on mat

This commit is contained in:
smanylov
2026-03-26 17:30:30 +07:00
parent c9f230a76f
commit 7ae0fecb61
8 changed files with 518 additions and 166 deletions
@@ -0,0 +1,39 @@
import { useQuery } from '@tanstack/react-query';
import { getFileViolations } from '@/app/actions/violationActions';
export interface ViolationFileDetail {
id: number;
url: string;
page_url: string;
page_title: string;
host: string;
status: string;
created_date: string;
file_id: string;
}
interface ViolationFile {
violations: ViolationFileDetail[],
total_elements: number,
total_pages: number,
current_page: number,
page_size: number,
has_next: boolean,
has_previous: boolean
}
export const useFileViolations = (id: string, page: number) => {
return useQuery({
queryKey: ['fileViolations', id, page],
queryFn: () => {
return getFileViolations(id, page)
},
select: (data: ViolationFile | null) => {
if (!data) {
return null
}
return data;
},
retry: false
});
};