import Head from 'next/head'; import { read, utils } from 'xlsx'; import base64 from "@/sheetjs.xlsx"; export default function Index({type, aoo}) { return ( <> {`SheetJS Next.JS ${type} Demo`}

{`SheetJS Next.JS ${type} Demo`}

This demo reads from /sheetjs.xlsx

It generates objects from the first sheet.

{aoo.map((row, R) => ( ))}
NameIndex
{row.Name} {row.Index}
); } export async function getStaticProps() { const wb = read(base64, {type: "base64"}); return { props: { type: "getStaticProps", aoo: utils.sheet_to_json(wb.Sheets[wb.SheetNames[0]]), }, } }