---
title: "Central Hub Component"
canonical_url: "https://docs.sportradar.com/resources/virtual-stadium/docs/ios/centralHub"
markdown_url: "https://docs.sportradar.com/resources/virtual-stadium/docs/ios/centralHub.md"
last_updated: "2026-10-20T09:07:17Z"
---

# Central Hub Component

The Central Hub component provides a comprehensive social betting platform where users can share bets, interact with the community, manage their profile, view notifications, and engage with other users. It serves as the central social hub for the Virtual Stadium experience.

## Overview

This guide will walk you through each step with code examples and best practices.

> **Info**
>
> - The SDK must be initialized with `Managers.SDK.shared.initialize()`
> - A valid JWT token must be provided for the logged-in user
> - A unique user ID must be provided for the logged-in user

***

## Basic Integration

### SwiftUI

The Central Hub component requires JWT authentication and a user ID. It can be integrated as a standalone screen or as part of your navigation flow.

**Required Parameters:**

- **`userJWT`** `String` *required* — JWT authentication token required to initialize the SDK and authenticate the user.
- **`userId`** `String` *required* — The unique identifier of the logged-in user.
- **`onCopyToBetslip`** `@escaping ((BetPayload) -> Void)` *required* — Callback invoked when a user copies a bet from another user. Returns the `BetPayload` to add to your bet slip.
- **`onBetShareHandler`** `@escaping ((([BetPayload]) -> Void) -> Void)` *required* — Callback invoked when the user wants to share a bet. Receives a completion handler that should be called with the user's bet slips.
- **`onClose`** `@escaping (() -> Void)` *required* — Callback invoked when the user navigates back or closes the Central Hub.

**Optional Parameters:**

- **`centralHubSettings`** `CentralHubSettings` *optional* — Customization settings for theming, fonts, translations, and UI behavior. Default: `CentralHubSettings()`. See [Translations](https://docs.sportradar.com/resources/virtual-stadium/docs/ios/translations.md) for Central Hub translation keys.
- **`analyticsProvider`** `AnalyticsProvider?` *optional* — Provider for logging analytics events throughout the SDK. Default: `nil`

> **Info**
>
> The Central Hub handles its own navigation internally, including profile screens, bet sharing, search, followers, and notifications.

**ContentView\.swift:**

```swift
import SwiftUI
import VirtualStadiumUISDK

struct ContentView: View {
    let userJWT = "<your-jwt-token>"
    let userId = "<your-user-id>"
    
    @State private var showCentralHub = true
    
    var body: some View {
        if showCentralHub {
            CentralHubView(
                userJWT: userJWT,
                userId: userId,
                centralHubSettings: CentralHubSettings(),
                onCopyToBetslip: { betPayload in
                    // Handle copying bet to user's bet slip
                    addBetToSlip(betPayload)
                },
                onBetShareHandler: { completion in
                    // Return user's bet slips for sharing
                    Task {
                        let betSlips = await getUserBetSlips()
                        completion(betSlips)
                    }
                },
                onClose: {
                    // Handle back navigation
                    showCentralHub = false
                }
            )
        }
    }
    
    private func getUserBetSlips() async -> [BetPayload] {
        /**
         * TODO(developer): Implement your bet slip fetching logic
         */
        return []
    }
    
    private func addBetToSlip(_ betPayload: BetPayload) {
        /**
         * TODO(developer): Implement your bet slip logic
         */
        print("Bet copied: \(betPayload.id)")
    }
}
```

***

## Configuration Parameters

The Central Hub component supports various configuration options to customize appearance, behavior, and functionality.

### Required Parameters

***

**`userJWT`** `String` *required*
JWT authentication token required to initialize the SDK and authenticate the user.

***

**`userId`** `String` *required*
The unique identifier of the logged-in user. This is used to personalize the Central Hub experience and distinguish between the user's own profile and other users' profiles.

***

**`onCopyToBetslip`** `@escaping ((BetPayload) -> Void)` *required*
Callback invoked when a user copies a bet from another user's shared bets. Returns the `BetPayload` to add to your bet slip.

**BetPayload Structure:**

```swift
public struct BetPayload {
    let id: String
    let betType: BetType           // Single, Multi, Bet Builder, etc.
    let selections: [Selection]
    let stake: Double
    let totalOdds: Double
    let potentialWin: Double
    // ... additional bet details
}
```

***

**`onBetShareHandler`** `@escaping ((([BetPayload]) -> Void) -> Void)` *required*

Callback invoked when the user wants to share a bet with the community. This function receives a completion handler that should be called with the user's available bet slips.

The completion handler pattern allows asynchronous fetching of bet slips from your backend or local storage.

***

**`onClose`** `@escaping (() -> Void)` *required*

Callback invoked when the user navigates back or closes the Central Hub. Use this to handle navigation back to your app's main interface.

***

### Optional Parameters

***

**`centralHubSettings`** `CentralHubSettings` *optional*

Customization settings for theming, fonts, translations, and UI behavior. Default is `CentralHubSettings()`. See [Central Hub Settings](#central-hub-settings) and [Translations](https://docs.sportradar.com/resources/virtual-stadium/docs/ios/translations.md#central-hub-centralhubtranslationsettings) for translation keys.

***

**`analyticsProvider`** `AnalyticsProvider?` *optional*

Provider for logging analytics events throughout the SDK. Default is `nil`.

***

## Main Features

### Profile Tab

The profile area can show:

- user details,
- follower and following counts,
- profile statistics,
- shared bet history, and
- profile privacy and edit flows for the current user.

### Bets Tab

The bets area supports:

- browsing shared bets,
- opening comments,
- reacting to bets,
- copying bets, and
- sharing a new bet from the current user's own bet slips.

### Ranks Tab

The leaderboard area supports:

- category filters,
- timeframe filters,
- the current user's rank, and
- paginated ranked users.

### Search, Followers, and Notifications

The component also includes:

- user search,
- followers and following screens,
- onboarding for first-time users, and
- bet, comment, and social notifications.

***

## Central Hub Settings

The Central Hub can be extensively customized through the `CentralHubSettings` struct. This allows you to match the component's appearance to your app's design system.

### Structure

```swift
public struct CentralHubSettings {
    public var oddsType: OddsType
    public var themeSettings: CentralHubThemeSettings
    public var sportIcons: SportIconSettings
    public var fontSettings: FontSettings
    public var translationSettings: CentralHubTranslationSettings
}
```

### Odds Type

Configure how odds are displayed throughout the Central Hub:

```swift
public enum OddsType: String {
    case us = "us"  // American format (+150, -200)
    case uk = "uk"  // Fractional format (3/2, 1/5)
    case eu = "eu"  // Decimal format (2.50, 1.20)
}
```

### Theme Settings

Control all color aspects of the Central Hub through `CentralHubThemeSettings`:

**Core Colors**

- **background** - Main background color for the Central Hub

**Screen-Specific Colors**

- **onboardingScreenColors** - Onboarding flow colors
- **followersScreenColors** - Followers/following screen colors
- **myHubScreenColors** - My profile screen colors
- **betsScreenColors** - Bets feed screen colors
- **searchScreenColors** - Search screen colors
- **betShareNotificationsScreenColors** - Bet notifications colors

**Component Colors**

- **cardColors** - Bet cards, profile cards, notification cards
- **buttonColors** - Follow, share, onboarding, sort, copy buttons
- **profileHeaderColors** - Profile header and statistics
- **navigationBarColors** - Top navigation bar
- **tabColors** - Profile/Bets tab selector
- **searchBarColors** - Search bar and input
- **alreadyReadDividerColors** - Read/unread divider
- **reactionsSheet** - Reactions bottom sheet
- **badgeColors** - Notification badges
- **switchColors** - Privacy toggle switches
- **filterBottomSheetColors** - Filter selection sheet
- **loaderColors** - Loading indicators

**Toast Colors**

- **toastColors** - Success, error, and follow toasts

***Custom Settings Example:***

```swift
import SwiftUI
import VirtualStadiumUISDK

let customSettings = CentralHubSettings(
    // Odds format
    oddsType: .us,  // American odds
    
    // Theme customization
    themeSettings: CentralHubThemeSettings(
        // Core background
        background: Color(red: 0.95, green: 0.95, blue: 0.97),
        
        // Toast colors
        toastColors: ToastColors(
            successColors: SuccessToastColors(
                backgroundColor: .green,
                textColor: .white,
                iconColor: .white,
                closeButtonColor: .white
            ),
            errorColors: ErrorToastColors(
                backgroundColor: .red,
                textColor: .white,
                iconColor: .white,
                closeButtonColor: .white
            )
        ),
        
        // Card colors
        cardColors: CentralHubCardsColors(
            betShare: BetShareCardColors(
                background: .white,
                contentText: .black,
                commentsIconColor: .blue,
                commentsTextColor: .black
            ),
            betSlip: BetSlipTheme(
                betslipBackgroundColor: .white,
                betslipBorderColor: Color.gray.opacity(0.2)
            )
        ),
        
        // Button colors
        buttonColors: CentralHubButtonColors(
            followButtonColors: FollowButtonColors(
                background: Color.blue.opacity(0.15),
                text: .blue
            ),
            shareBetslipButtonColors: ShareBetslipButtonColors(
                backgroundColor: .blue,
                textColor: .white
            )
        ),
        
        // Navigation bar
        navigationBarColors: CentralHubNavigationBarColors(
            background: .white,
            title: .black,
            icons: .black
        ),
        
        // Tab colors
        tabColors: TabColors(
            selectedTextColor: .black,
            unselectedTextColor: .gray,
            backgroundColor: Color.gray.opacity(0.2),
            selectedBackgroundColor: .white,
            tabContainerBackground: .white
        ),
        
        // Onboarding
        onboardingScreenColors: CentralHubOnboardingScreenColors(
            backgroundColor: .white,
            onboardingIcon: .blue,
            welcomeTextColor: .black,
            featureItem: FeatureItemColors(
                featureIcon: .blue,
                titleColor: .black,
                descriptionColor: .gray
            )
        )
    ),
    
    // Font customization
    fontSettings: FontSettings(
        fontRegular: UIFont(name: "CustomFont-Regular", size: 16),
        fontMedium: UIFont(name: "CustomFont-Medium", size: 16),
        fontBold: UIFont(name: "CustomFont-Bold", size: 16)
    ),
    
    // Translation customization
    translationSettings: CentralHubTranslationSettings(
        // Customize all text strings
        general: GeneralTranslations(
            follow: "Follow",
            unfollow: "Unfollow",
            copyBetslip: "COPY BET"
        )
    )
)

// Use in CentralHubView
CentralHubView(
    userJWT: jwt,
    userId: userId,
    centralHubSettings: customSettings,
    onCopyToBetslip: { bet in
        copyBet(bet)
    },
    onBetShareHandler: { completion in
        Task {
            let bets = await getBets()
            completion(bets)
        }
    },
    onClose: {
        // Handle close
    }
)
```

***

### Sport Icon Settings

Customize sport icons displayed throughout the Central Hub for different sports like soccer, basketball, etc.

`SportIconSettings` allows you to override the default sport icons with your own custom images. This is particularly useful when you want to match your app's design system or provide higher quality sport-specific imagery.

**Use Cases:**

- Replace default sport icons with branded versions
- Provide custom icons for specific sports

**Sport Icons appear in:**

- Bet cards showing event information
- Event headers in bet details
- Notification cards for bet share events

**SportIconSettings Properties:**

**`sportIconHandler`** `((String?) -> Image)?` *optional*

A closure that receives a sport ID string and returns the corresponding `Image`. The sport ID is typically a string representation of the Sportradar sport identifier. You must provide an image for all sport IDs, including a default fallback for unknown sports.

**Parameters:**

- `sportId`: Optional string representing the sport (e.g., "**1**" for soccer, "**2**" for basketball)

**Returns:** `Image` to display for the given sport. Always provide a default image for unknown sport IDs.

***Sport Icon Customization:***

```swift
import SwiftUI
import VirtualStadiumUISDK

// Example: Custom sport icons
let customSportIcons = SportIconSettings { sportId in
    switch sportId {
    case "1":  // Soccer
        return Image("custom_soccer_icon")
    case "2":  // Basketball
        return Image("custom_basketball_icon")
    default:
        return Image("default_sport_icon") // Default fallback
    }
}

// Use in CentralHubSettings
let settings = CentralHubSettings(
    oddsType: .eu,
    themeSettings: CentralHubThemeSettings(),
    sportIcons: customSportIcons,
    fontSettings: FontSettings(),
    translationSettings: CentralHubTranslationSettings()
)

// Apply to CentralHubView
CentralHubView(
    userJWT: jwt,
    userId: userId,
    centralHubSettings: settings,
    onCopyToBetslip: { bet in
        copyBet(bet)
    },
    onBetShareHandler: { completion in
        Task {
            let bets = await getBets()
            completion(bets)
        }
    },
    onClose: {
        // Handle close
    }
)
```

**Common Sport IDs:**

```swift
// Sportradar Sport IDs (examples)
// "1" = Soccer
// "2" = Basketball

let sportIcons = SportIconSettings { sportId in
    switch sportId {
    case "1":
        return Image("soccer_icon")
    case "2":
        return Image("basketball_icon")
    default:
        return Image("generic_sport_icon") // Always provide default
    }
}
```

***

### Font Settings

Use your app's custom fonts throughout the Central Hub:

```swift
public struct FontSettings {
    public let fontUltraLight: UIFont
    public let fontThin: UIFont
    public let fontLight: UIFont
    public let fontRegular: UIFont
    public let fontMedium: UIFont
    public let fontSemibold: UIFont
    public let fontBold: UIFont
    public let fontHeavy: UIFont
    public let fontBlack: UIFont
    public var inputFieldPlaceholderFont: UIFont
}
```

***Custom Fonts Example:***

```swift
let customFonts = FontSettings(
    fontRegular: UIFont(name: "YourFont-Regular", size: 16),
    fontMedium: UIFont(name: "YourFont-Medium", size: 16),
    fontBold: UIFont(name: "YourFont-Bold", size: 16),
    inputFieldPlaceholderFont: UIFont(name: "YourFont-Regular", size: 17)
)

let settings = CentralHubSettings(
    fontSettings: customFonts
)
```

***

### Translation Settings

Customize all text strings displayed in the Central Hub for complete localization control:

```swift
public struct CentralHubTranslationSettings {
    public var navigationTitles: NavigationTitleTranslations
    public var onboarding: OnboardingTranslations
    public var segmentedSectionTabTranslations: SegmentedSectionTranslations
    public var profileHub: ProfileHubTranslations
    public var otherUserProfileHub: OtherUserProfileHubTranslations
    public var betsHub: BetsHubTranslations
    public var sortingSheet: SortingSheetTranslations
    public var editProfile: EditProfileTranslations
    public var followersHub: FollowersHubTranslations
    public var commentingHub: CommentingHubTranslations
    public var shareBetHub: ShareBetHubTranslations
    public var betshareNotificationsHub: BetshareNotificationHubTranslations
    public var socialNotificationsHub: SocialNotificationHubTranslations
    public var userSearch: UserSearchTranslations
    public var userHeaderNotificationDescription: UserHeaderNotificationDescriptionTranslation
    public var betView: BetViewTranslations
    public var general: GeneralTranslations
}
```

***Custom Translations Example:***

```swift
let spanishTranslations = CentralHubTranslationSettings(
    navigationTitles: NavigationTitleTranslations(
        profile: "Perfil",
        bets: "Apuestas",
        search: "Buscar",
        followers: "Seguidores",
        following: "Siguiendo"
    ),
    betsHub: BetsHubTranslations(
        shareBetslipButtonTitle: "Compartir Apuesta",
        createdFilterSectionTitle: "ÚLTIMAS APUESTAS",
        copyCountFilterSectionTitle: "MÁS COPIADAS",
        commentCountFilterSectionTitle: "MÁS COMENTADAS",
        emptyContent: "Sin apuestas compartidas"
    ),
    general: GeneralTranslations(
        follow: "Seguir",
        unfollow: "Dejar de seguir",
        copyBetslip: "COPIAR APUESTA",
        bets: "Apuestas",
        copied: "Copiado"
    )
)

let settings = CentralHubSettings(
    translationSettings: spanishTranslations
)
```

***

## Bet Sharing Implementation

To enable bet sharing, provide the `onBetShareHandler` callback that returns your user's bet slips. The Central Hub will display these bets in a selection screen where users can choose which bet to share.

### BetPayload Structure

The `BetPayload` model represents a bet slip that can be shared and copied. Ensure your bet data is properly mapped to this structure.

**Key Requirements:**

- Include all bet selections with markets and outcomes
- Provide accurate odds and potential winnings
- Include bet type (Single, Multi, Bet Builder, etc.)
- Add timestamps for bet creation/placement

The same `BetPayload` structure is used for both sharing bets and copying bets via the `onCopyToBetslip` callback.

***Bet Sharing Implementation:***

```swift
import SwiftUI
import VirtualStadiumUISDK

struct CentralHubContainer: View {
    let jwt: String
    let userId: String
    
    @State private var showToast = false
    @State private var toastMessage = ""
    
    var body: some View {
        CentralHubView(
            userJWT: jwt,
            userId: userId,
            centralHubSettings: CentralHubSettings(),
            
            // Handle bet copying
            onCopyToBetslip: { copiedBet in
                // Add the copied bet to user's bet slip
                addToBetSlip(copiedBet)
                
                // Show confirmation
                toastMessage = "Bet copied to slip!"
                showToast = true
            },
            
            // Provide user's bet slips for sharing
            onBetShareHandler: { completion in
                Task {
                    /**
                     * TODO(developer): Fetch from your backend
                     */
                    // Fetch user's current bet slips
                    let myBets = await fetchUserBetSlips()
                    
                    // Map to BetPayload format
                    let betPayloads = myBets.map { bet in
                        BetPayload(
                            id: bet.id,
                            betSlipId: bet.slipId,
                            betType: bet.type,
                            currency: bet.currency,
                            combinedOdds: Odds(
                                decimalValue: Float(bet.totalOdds),
                                displayValue: "\(bet.totalOdds)"
                            ),
                            stake: Stake(
                                value: bet.stake,
                                currencyCode: bet.currency
                            ),
                            payout: Payout(
                                value: bet.potentialWin,
                                currencyCode: bet.currency
                            ),
                            cashOut: nil,
                            bets: bet.selections.map { selection in
                                Bet(
                                    id: selection.id,
                                    betType: selection.type,
                                    event: BetEvent(
                                        id: selection.eventId,
                                        name: selection.eventName,
                                        teams: selection.teams
                                    ),
                                    markets: [
                                        BetMarket(
                                            id: selection.marketId,
                                            name: selection.marketName,
                                            outcomes: [
                                                Outcome(
                                                    id: selection.outcomeId,
                                                    name: selection.outcomeName,
                                                    odds: Odds(
                                                        decimalValue: Float(selection.odds),
                                                        displayValue: "\(selection.odds)"
                                                    )
                                                )
                                            ]
                                        )
                                    ],
                                    odds: Odds(
                                        decimalValue: Float(selection.odds),
                                        displayValue: "\(selection.odds)"
                                    )
                                )
                            }
                        )
                    }
                    
                    completion(betPayloads)
                }
            },
            
            onClose: {
                // Handle close
            }
        )
        .toast(isPresented: $showToast, message: toastMessage)
    }
    
    private func fetchUserBetSlips() async -> [MyBet] {
        /**
         * TODO(developer): Implement your bet fetching logic
         */
        // Example: return await apiClient.fetchUserBetSlips()
        return []
    }
    
    private func addToBetSlip(_ bet: BetPayload) {
        /**
         * TODO(developer): Implement bet slip logic
         */
        print("Adding bet to slip: \(bet.id)")
        // Example: betSlipManager.addBet(bet)
    }
}
```

1. **Step 1**

   #### Imports

   Import `SwiftUI` and `VirtualStadiumUISDK`.

2. **Step 2**

   #### View Properties

   Declare `jwt` and `userId` inputs. Add `showToast` and `toastMessage` state to display confirmation feedback when a bet is copied.

3. **Step 3**

   #### CentralHubView Setup

   Initialize `CentralHubView` with the required `userJWT`, `userId`, and a default `CentralHubSettings()`. The three required callbacks follow below.

4. **Step 4**

   #### onCopyToBetslip

   Called when a user copies a bet from another user's shared slip. Add the received `BetPayload` to your bet slip and show a toast confirmation.

5. **Step 5**

   #### onBetShareHandler

   Called when the user wants to share a bet. Fetch the user's bet slips asynchronously, map each one to a `BetPayload` — including `combinedOdds`, `stake`, `payout`, and nested `Bet` selections with their `BetEvent`, `BetMarket`, and `Outcome` — then call `completion` with the resulting array.

6. **Step 6**

   #### onClose

   Called when the user navigates back or closes the Central Hub. Handle any navigation or cleanup logic here.

7. **Step 7**

   #### Helper Methods

   `fetchUserBetSlips` fetches the user's current bet slips from your backend. `addToBetSlip` adds a copied `BetPayload` to the user's local bet slip. Replace each `TODO` with your actual integration logic.

***

## Complete Example

***Complete Central Hub Integration Example:***

```swift
import SwiftUI
import VirtualStadiumUISDK
import Combine

class CentralHubViewModel: ObservableObject {

    @Published var jwtToken: String
    @Published var userId: String
    @Published var isLoading: Bool = true
    
    init(jwtToken: String, userId: String) {
        self.jwtToken = jwtToken
        self.userId = userId
    }
    
        
    func fetchUserBetSlips() -> [BetPayload] {
        /**
         * TODO(developer): Fetch bets and convert them to BetPayload array. The example here converts a mock bet from JSON to BetPayload
         */
        let jsonString = """
        {
            "id": "sr:bet-share-event:12345678901",
            "betSlipId": "some:123",
            "betType": "single",
            "currency": "€",
            "combinedOdds": {
                "decimalValue": 5.67
            },
            "stake": {
                "value": "25,00"
            },
            "payout": {
                "value": "37.50"
            },
            "bets": [
                {
                    "id": "x",
                    "betType": "single",
                    "event": {
                        "id": "x1",
                        "name": "Manchester United VS Chelsea",
                        "sportId": "1"
                    },
                    "markets": [
                        {
                            "id": "a",
                            "name": "1 x 2",
                            "outcomes": [
                                {
                                    "id": "a1",
                                    "name": "Manchester United"
                                }
                            ]
                        }
                    ]
                }
            ]
        }
    """
        return [try! JSONDecoder().decode(BetPayload.self, from: jsonString.data(using: .utf8)!)]
    }
    
    func addBetToSlip(_ bet: BetPayload) {
        /**
         * TODO(developer): Implement copy bet slip logic
         */
        print("Adding bet: \(bet.id)")
    }
    
    func loadSDK() async {
        Task {
            do {
                try await VirtualStadiumUISDK_STGDEV.Managers.SDK.shared.initialize()
                self.isLoading = false
            } catch {
                print("Error initializing SDK: \(error)")
            }
        }
    }
}

struct CentralHubViewContainer: View {

    @StateObject private var viewModel: CentralHubViewModel
    
    init() {
        _viewModel = StateObject(
            wrappedValue: CentralHubViewModel(
                jwtToken: "Pre generated JWT",
                userId: "userId"
            )
        )
    }
    
    var body: some View {
        VStack {
            switch viewModel.isLoading {
            case false:
                CentralHubView(
                    userJWT: viewModel.jwtToken,
                    userId: viewModel.userId,
                    centralHubSettings: createCustomSettings(),
                    
                    onCopyToBetslip: { bet in
                        viewModel.addBetToSlip(bet)
                    },
                    
                    onBetShareHandler: { completion in
                        let bets = viewModel.fetchUserBetSlips()
                        completion(bets)
                    },
                    
                    onClose: {
                        // Close central hub
                    }
                )
            case true:
                ProgressView()
            }
        }
        .task {
            await viewModel.loadSDK()
        }
    }
    
    private func createCustomSettings() -> CentralHubSettings {
        // Custom theme
        let customTheme = CentralHubThemeSettings(
            background: Color(red: 0.95, green: 0.95, blue: 0.97),
            
            toastColors: ToastColors(
                successColors: SuccessToastColors(
                    backgroundColor: .green,
                    textColor: .white
                )
            ),
            
            buttonColors: CentralHubButtonColors(
                followButtonColors: FollowButtonColors(
                    background: Color.blue.opacity(0.15),
                    text: .blue
                ),
                shareBetslipButtonColors: ShareBetslipButtonColors(
                    backgroundColor: .blue,
                    textColor: .white
                )
            ),
            
            navigationBarColors: CentralHubNavigationBarColors(
                background: .white,
                title: .black,
                icons: .black
            )
        )
        
        // Custom sport icons
        let customSportIcons = SportIconSettings { sportId in
            switch sportId {
            case "1":  // Soccer
                return Image("custom_soccer_icon")
            case "2":  // Basketball
                return Image("custom_basketball_icon")
            default:
                return Image("generic_sport_icon")
            }
        }
        
        // Custom fonts
        let customFonts = FontSettings(
            fontRegular: UIFont(name: "CustomFont-Regular", size: 16),
            fontMedium: UIFont(name: "CustomFont-Medium", size: 16),
            fontBold: UIFont(name: "CustomFont-Bold", size: 16)
        )
        
        return CentralHubSettings(
            oddsType: .us,
            themeSettings: customTheme,
            sportIcons: customSportIcons,
            fontSettings: customFonts,
            translationSettings: CentralHubTranslationSettings()
        )
    }
}

struct MainAppView: View {
    var body: some View {
        CentralHubViewContainer()
    }
}

// Preview
struct CentralHubScreen_Previews: PreviewProvider {
    static var previews: some View {
        CentralHubViewContainer()
    }
}
```

1. **Step 1**

   #### Imports

   Import `SwiftUI`, `VirtualStadiumUISDK`, and `Combine`.

2. **Step 2**

   #### CentralHubViewModel — Properties & Init

   Define `jwtToken`, `userId`, and `isLoading` as `@Published` properties. The `isLoading` flag controls whether the SDK has finished initializing before the view is rendered.

3. **Step 3**

   #### fetchUserBetSlips

   Fetches and returns the user's current bet slips as a `[BetPayload]` array. The example decodes a mock JSON bet — replace with your actual backend call.

4. **Step 4**

   #### addBetToSlip

   Called when a user copies a bet from another user. Replace with your sportsbook bet slip integration logic.

5. **Step 5**

   #### loadSDK

   Initializes the Virtual Stadium SDK asynchronously. Sets `isLoading = false` on success so the view switches from `ProgressView` to `CentralHubView`.

6. **Step 6**

   #### CentralHubViewContainer — Setup

   Define the container view with a `@StateObject` view model. Pre-populate `jwtToken` and `userId` in `init()` — replace with your real values from your auth system.

7. **Step 7**

   #### CentralHubView — Conditional Rendering

   Switch on `viewModel.isLoading`: show `CentralHubView` with all callbacks once the SDK is ready, otherwise show a `ProgressView`. The `.task` modifier triggers `loadSDK()` when the view appears.

8. **Step 8**

   #### createCustomSettings

   Build a `CentralHubSettings` instance with a custom theme (background, toast, button, and navigation bar colors), custom sport icons per Sportradar sport ID, and custom fonts. Return it as the `centralHubSettings` argument.

9. **Step 9**

   #### MainAppView & Preview

   `MainAppView` is the entry point that renders `CentralHubViewContainer`. The `PreviewProvider` allows you to preview the full integration directly in Xcode canvas.

***
