Folder Structure


  • Convert the given nested objects to represent folder structure on the screen.
  • The function signature of the used function should be like structure(files).
  • The depth should be shown exactly like the level of the nested objects.
export default function Home() {
  let files = {
    inbox: {
      games: {
        rounds: {
          Folders: {},
          groups: {},
        },
      },
    },
    outbox: {},
  };

  return (
    <main className="flex bg-beige h-screen">
      <div className="m-auto text-xl font-medium flex flex-col">
        {structure(files)}
      </div>
    </main>
  );
}
image found