import Menu from '@/lib/auth/components/Menu'; import { useState } from 'react'; import * as XLSX from 'xlsx'; const ProductsRecomendation = ({ id }) => { const [excelData, setExcelData] = useState(null); const handleSubmit = (e) => { e.preventDefault(); if (excelData) { // Lakukan operasi pencarian atau operasi lainnya di sini console.log('ini data excel',excelData); // Contoh: Menampilkan data excel ke konsol } else { console.log('No excel data available'); } }; const handleFileChange = (e) => { const file = e.target.files[0]; const reader = new FileReader(); reader.onload = (event) => { const data = new Uint8Array(event.target.result); const workbook = XLSX.read(data, { type: 'array' }); const sheetName = workbook.SheetNames[0]; const sheet = workbook.Sheets[sheetName]; const jsonData = XLSX.utils.sheet_to_json(sheet, { header: 1, range: 1 }); setExcelData(jsonData); }; reader.readAsArrayBuffer(file); }; return (

Generate Recomendation

Contoh Excel

Product Qty
Tekiro Long Nose Pliers Tang Lancip 10
); }; export default ProductsRecomendation;