File Uploader

"use client";
import { FileUpload } from "@ninjha01/nitro-ui";

export const Default = () => {
  return (
    <FileUpload
      parseFile={async (f) => {
        return { fileName: f.name, success: true, data: { foo: "bar" } };
      }}
      upload={async (res: {
        fileName: string;
        success: true;
        data: unknown;
      }) => {
        alert("Uploaded " + res.fileName);
      }}
    />
  );
};

With Validation

TODO

Was this page helpful?