Files
vps-tracker/apps/web/src/lib/export-csv.ts
T
DenozordecandCursor 0ea92746e4
Docker / build (push) Has been cancelled
refactor(web): унифицировать UI по паттернам ReUI на всех 12 страницах
Ввести CrudListPage, AnalyticsPage, RowActions и domain edit sheets с FormSheetRhf; убрать устаревшие TableCard/DataTableCard.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-28 13:16:00 +07:00

31 lines
619 B
TypeScript

import { toCsv, downloadTextFile } from '@/lib/format'
export function exportVpsCsv(
rows: Record<string, unknown>[],
fileName = 'vps-export.csv',
): void {
downloadTextFile(fileName, toCsv(rows))
}
export function exportActiveVpsCsv(
vps: Array<{
ip: string
status: string
project?: string
currency: string
monthlyRate?: number | null
}>,
fileName = 'vps-export.csv',
): void {
exportVpsCsv(
vps.map((v) => ({
ip: v.ip,
status: v.status,
project: v.project ?? '',
currency: v.currency,
monthlyRate: v.monthlyRate ?? 0,
})),
fileName,
)
}