Back

Version 43

2/8/2025
/** @jsxImportSource https://esm.sh/react@18.2.0 */
import Papa from "https://esm.sh/papaparse@5.4.1";
import { createRoot } from "https://esm.sh/react-dom@18.2.0/client";
import React, { useCallback, useState } from "https://esm.sh/react@18.2.0";

interface SalesRecord {
date: string;
artist: string;
itemType: string;
itemName: string;
itemPrice: number;
quantity: number;
netAmount: number;
// currency: string;
}

interface ArtistSummary {
name: string;
totalSales: number;
totalTracks: number;
totalAlbums: number;
releases: Array<{ name: string; type: string; sales: number }>;
}

interface MonthlyBreakdown {
month: string;
totalSales: number;
artistSales: Record<string, number>;
}

function CSVUploader() {
const [file, setFile] = useState<File | null>(null);
const [processingResult, setProcessingResult] = useState<
{
artistSummary: ArtistSummary[];
monthlyBreakdown: MonthlyBreakdown[];
geordie-bandcampcsvprocessor.web.val.run
Updated: February 8, 2025