'use client';

import { useQuery } from '@tanstack/react-query';
import { listAuditLog, type AuditLogFilters } from '../api/audit-log';

export function useAuditLog(filters: AuditLogFilters) {
  return useQuery({
    queryKey: ['audit-log', filters],
    queryFn: () => listAuditLog(filters),
    staleTime: 30 * 1000,
  });
}
