Refactor ImportModal code to use useState and useContext hooks

This commit refactors the code for the ImportModal component to use hooks like useState and useContext, resulting in improved readability and maintainability. It also adds functionality to load prebuilt examples and handle local file uploads.
This commit is contained in:
Gabriel Almeida 2023-04-25 11:02:09 -03:00 • committed by Gabriel Luiz Freitas Almeida
commit c522727d6e

View file

@ -109,10 +109,12 @@ export default function ImportModal() {
<ArrowLeftIcon className="h-6 w-6" aria-hidden="true" /> <ArrowLeftIcon className="h-6 w-6" aria-hidden="true" />
</button> </button>
</div> </div>
<div className="z-50 absolute bottom-2 left-0 hidden pt-4 pl-2 sm:block"> <div className="z-50 absolute bottom-2 left-1/2 transform -translate-x-1/2 hidden pt-4 pl-2 sm:block text-center">
<a <a
href="https://github.com/logspace-ai/langflow_examples" href="https://github.com/logspace-ai/langflow_examples"
target="_blank" target="_blank"
className="flex items-center justify-center"
rel="noreferrer"
> >
<svg <svg
width="24" width="24"
@ -126,6 +128,7 @@ export default function ImportModal() {
fill="#24292f" fill="#24292f"
/> />
</svg> </svg>
<span className="ml-2">LangFlow Examples</span>
</a> </a>
</div> </div>
</> </>