harveyai/react-doc-viewer ? reverse-engineered prompt

Reverse engineered prompt

Build me a React document viewer component that can display common files like PDFs, Word docs, Excel sheets, PowerPoints, text files, CSVs, images, and HTML from either a remote URL or a local file. I want to pass in an array of documents and have the viewer show the first one by default, with props to set the initial file and to fully control the active file from the parent if needed.

It should also support uploaded files through blob URLs, let me plug in custom renderers for different file types, and include a nice default set of renderers. Please make it easy to theme with a few color options, and let me customize the request used to inspect files before loading them, since some links only work with certain methods.

Use TypeScript and make it feel polished enough to use as a reusable package, with a Storybook demo if that fits naturally. If you need to check current docs or file handling behavior, look it up online.

Are you gonna build this?

make sure you review the code using coderabbit

Try freeSponsored — opens CodeRabbit in a new tab