diff --git a/src/components/DownloadCSV.tsx b/src/components/DownloadCSV.tsx index 6ee40e0..0775d1e 100644 --- a/src/components/DownloadCSV.tsx +++ b/src/components/DownloadCSV.tsx @@ -19,17 +19,21 @@ interface DownloadCSVProps { benefitName: string; } -const options = [ - { label: "SBI to SBI", value: "sbiToSbi" }, - { label: "SBI to Other Bank", value: "sbiToOtherBanks" }, -]; - const DownloadCSV: React.FC = ({ benefitId, benefitName, }) => { const [loadingOption, setLoadingOption] = useState(null); const toast = useToast(); + const rawOptions = import.meta.env.VITE_APP_CSV_OPTIONS || "[]"; + + let options; + try { + options = JSON.parse(rawOptions); + } catch (e) { + options = []; + console.error("Invalid CSV options JSON in env", e); + } const handleDownload = async (selectedOption: string) => { setLoadingOption(selectedOption);