<!-- source-hash: bedf0eba103ca6d913d9e320399c3706 -->
A data table component for displaying query results with horizontal scrolling, CSV export, loading skeletons, and empty states.

## Key Components

- **`QueryReportTable`** — Main export. Renders a full-featured data table driven by an array of row objects, with automatic column derivation from data keys.
- **`deriveColumns`** — Utility that infers column definitions from data and an optional `columnOrder` array.
- **`exportToCSV`** — Utility that serializes table data to a downloadable CSV file.
- **`useHorizontalScrollbar`** — Hook providing custom scrollbar state and event handlers (thumb drag, track click, edge fades).
- **`QueryReportTableHeader`** / **`QueryReportTableRow`** / **`QueryReportTableSkeleton`** — Sub-components for the header, data rows, and loading state respectively.

## Props Overview

| Prop | Default | Description |
|------|---------|-------------|
| `data` | — | Array of row objects to display |
| `loading` | `false` | Shows skeleton rows when `true` |
| `variant` | `'default'` | `'default'` or `'compact'` — hides title bar, scrollbar, and edge fades in compact mode |
| `columnOrder` | — | Optional array to control column ordering |
| `showExport` | `true` | Renders an "Export CSV" button |
| `columnWidth` | `160` | Per-column width in pixels |
| `headerActions` | — | Slot for additional header controls |

## Usage Example

```typescript
import { QueryReportTable } from './query-report-table'

const rows = [
  { device: 'DESKTOP-01', os: 'Windows 11', status: 'Online' },
  { device: 'LAPTOP-22',  os: 'macOS 14',   status: 'Offline' },
]

export function ReportPage() {
  return (
    <QueryReportTable
      title="Device Report"
      data={rows}
      columnOrder={['device', 'os', 'status']}
      exportFilename="device-report"
      onExport={() => console.log('exported')}
    />
  )
}
```

In `compact` mode the title bar, custom scrollbar, and edge-fade overlays are suppressed — useful for embedding the table inside a card or modal without extra chrome.