5 min readUpdated Mar 2, 2026

CompaniesManagement

Overview

The CompaniesManagement component serves as a user interface for managing company data within the Vantage analytics and data platform. It allows users to perform typical CRUD (Create, Read, Update, Delete) operations on a list of companies, search through the companies, and view relevant details about each company, such as user count and tokens used. The component is optimized for usability and includes data fetching, loading states, and confirmatory modals for deletion.

Settings

1. Clients State Management

2. Loading State

3. Search Query

4. Modal State (for adding/editing companies)

5. Editing Company State

6. Delete Target Company

7. Delete Confirmation State

How it Works

  1. Data Fetching:

    • The component fetches company data from the API endpoint /api/organization/clients using the fetchClients function on initial render.
    • Upon a successful request, it populates the clients state with received data.
  2. Creating/Editing a Company:

    • Users can open the modal to either create a new company or edit an existing one. On save, it triggers handleSaveCompany, which sends a request to the same API endpoint but uses different HTTP methods (POST for creating and PUT for editing).
  3. Deleting a Company:

    • When a user chooses to delete a company, it sets the deleteTarget state, which opens a confirmation modal. If deletion is confirmed, it invokes confirmDelete to send a DELETE request to the API.
  4. Filtered Search:

    • The component supports real-time search filtering of the company list based on the searchQuery input.
  5. Loading State Management:

    • Throughout data fetching, the loading state provides user feedback.
  6. Display Layout:

    • The company list is displayed within a styled table with relevant company information such as name, user count, tokens used, monthly budget, and usability status.

Use Cases & Examples

Use Case 1: New Company Onboarding

A business needs to onboard a new client company into their system. Using this component, an admin can enter all relevant information such as company name, user details, and financial allocations.

Use Case 2: Company Status Management

In a SaaS environment, companies may choose to deactivate their accounts temporarily or permanently. This component allows admins to manage their active and inactive statuses and reassign resources appropriately.

Example Configuration

Use Case: New Company Onboarding

To onboard a new company, an administrator might use the following configuration as they fill out the modal form:

This information will be submitted, resulting in a POST request to the /api/organization/clients endpoint. If successful, it adds "Tech Innovations Inc." to the company list with the assigned parameters.

Conclusion

The CompaniesManagement component is crucial for managing business operations within Vantage, providing a full suite of tools for creating, editing, searching, and deleting company entries, all while ensuring a smooth user experience. It plays a vital role in maintaining the core data integrity of the Vantage platform.