# Markets

The `Markets` component displays a list of market entities, differentiated into "Favorite Markets" and a general "Markets" category. It provides a UI for user interaction with market entries.

#### Props

* **`markets`** (`Market[]`): Array of market objects representing all available markets.
* **`favoriteMarkets`** (`Market[]`): Array of market objects that the user has marked as favorites.

#### Behavior

* Displays two sections if conditions are met:
  1. **Favorite Markets**: Shown if there are entries in both `markets` and `favorites` arrays. `useNeutralMarkets` is a custom hook that filters out markets listed in `favorites` from the total list of markets retrieved via `useMarkets`.&#x20;
  2. **Markets**: Always displayed, listing all markets or showing an empty state if no markets are available.
* Uses `MarketRow` components to render individual market entries in both sections.

#### Hooks

* **`useState`** (`favorites`): Initializes and manages an array of favorite markets based on the `favoriteMarkets` prop.
* **`useNeutralMarkets`**: Fetches an array of all neutral market entries, markets not market as favorite.

<br>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://symmdocs.gitbook.io/frontend-sdk-technical-docs/frontend-sdk/cloverfield-app/components/markets.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
