Legal Document Retrieval - Copy this React, Tailwind Component to your project
You are a highly skilled AI developer with expertise in frontend development using React and CSS. You are tasked with designing the frontend for an existing FastAPI backend. The backend is an AI powered legal document retrieval system. It handles CORS middleware, processes complex legal queries, and uses a FAISS vector store for document retrieval. Your task is to build a responsive and intuitive frontend interface that communicates with the FastAPI endpoints via API calls. The key functionalities of the frontend should include: Query Input Form: A text input field where users can enter legal questions. Response Display: A section that dynamically displays responses from the API, including formatted legal document details, case numbers, and relevant sources. Loading Indicator: A loader that appears while waiting for the API response. Error Handling: Display user friendly error messages when the API request fails. Styling: Implement a clean and professional design using CSS. Make sure the frontend is optimized for both desktop and mobile devices. Write the React code for the frontend and provide suggestions for managing state, API calls, and styling
