//
//  BottomButtonsView.swift
//  lichunWebsocket
//
//  Game control buttons (Start/Stop/Restart) with cozy styling
//

import SwiftUI

struct BottomButtonsView: View {
    @EnvironmentObject var webSocketService: WebSocketService

    var body: some View {
        HStack(spacing: AppSpacing.sm) {
            PrimaryButton(
                title: "Start",
                action: {
                    webSocketService.sendMessage(message: WebSocketCommands.command("start"))
                },
                backgroundColor: AppColors.success
            )

            PrimaryButton(
                title: "Stop",
                action: {
                    webSocketService.sendMessage(message: WebSocketCommands.command("stop"))
                },
                backgroundColor: AppColors.error
            )

            SecondaryButton(
                title: "Restart",
                action: {
                    webSocketService.sendMessage(message: WebSocketCommands.command("restart"))
                },
                color: AppColors.warning
            )
        }
        .padding(.horizontal, AppSpacing.md)
        .padding(.vertical, AppSpacing.sm)
    }
}

// MARK: - Preview
// Preview removed - requires backend connection
