// ©AngelaMos | 2026 // index.tsx import { useState } from 'react' import { useIOCs } from '@/api/hooks' import { API_ENDPOINTS, BLOCKLIST_FORMATS, PAGINATION } from '@/config' import { apiClient } from '@/core/api' import styles from './intel.module.scss' function downloadBlob(data: string, filename: string, mime: string) { const blob = new Blob([data], { type: mime }) const url = URL.createObjectURL(blob) const a = document.createElement('a') a.href = url a.download = filename a.click() URL.revokeObjectURL(url) } export function IntelPage() { const [offset, setOffset] = useState(0) const { data, isLoading } = useIOCs(PAGINATION.DEFAULT_LIMIT, offset) const iocs = data?.data ?? [] const total = data?.total ?? 0 async function exportSTIX() { const res = await apiClient.get(API_ENDPOINTS.IOCS.EXPORT_STIX, { responseType: 'text', }) downloadBlob(res.data as string, 'hive-iocs.stix.json', 'application/json') } async function exportBlocklist(format: string) { const res = await apiClient.get(API_ENDPOINTS.IOCS.EXPORT_BLOCKLIST, { params: { format }, responseType: 'text', }) const ext = format === 'csv' ? '.csv' : '.txt' downloadBlob(res.data as string, `hive-blocklist${ext}`, 'text/plain') } return (
| Type | Value | Confidence | Sightings | Source | First Seen | Last Seen |
|---|---|---|---|---|---|---|
| {ioc.type} | {ioc.value} | {ioc.confidence}% | {ioc.sight_count} | {ioc.source} | {new Date(ioc.first_seen).toLocaleDateString()} | {new Date(ioc.last_seen).toLocaleDateString()} |