@model LittleShop.DTOs.BotRegistrationDto

@{
    ViewData["Title"] = "Register New Bot";
}

<h1>Register New Bot</h1>

<hr />
<div class="row">
    <div class="col-md-6">
        <form action="/Admin/Bots/Create" method="post">
            @Html.AntiForgeryToken()
            <div asp-validation-summary="ModelOnly" class="text-danger"></div>
            
            @if (ViewData.ModelState.IsValid == false)
            {
                <div class="alert alert-danger">
                    <ul>
                        @foreach (var error in ViewData.ModelState.Values.SelectMany(v => v.Errors))
                        {
                            <li>@error.ErrorMessage</li>
                        }
                    </ul>
                </div>
            }
            
            <div class="mb-3">
                <label for="Name" class="form-label">Bot Name</label>
                <input name="Name" id="Name" class="form-control" placeholder="e.g., Customer Service Bot" required />
                <span class="text-danger"></span>
            </div>
            
            <div class="mb-3">
                <label for="Description" class="form-label">Description</label>
                <textarea name="Description" id="Description" class="form-control" rows="3" 
                          placeholder="Brief description of what this bot does"></textarea>
                <span class="text-danger"></span>
            </div>
            
            <div class="mb-3">
                <label for="Type" class="form-label">Bot Type</label>
                <select name="Type" id="Type" class="form-select">
                    <option value="0">Telegram</option>
                    <option value="1">Discord</option>
                    <option value="2">WhatsApp</option>
                    <option value="3">Signal</option>
                    <option value="4">Matrix</option>
                    <option value="5">IRC</option>
                    <option value="99">Custom</option>
                </select>
                <span class="text-danger"></span>
            </div>
            
            <div class="mb-3">
                <label for="Version" class="form-label">Bot Version</label>
                <input name="Version" id="Version" class="form-control" placeholder="e.g., 1.0.0" />
                <span class="text-danger"></span>
            </div>

            <div class="mb-3">
                <label class="form-label">Initial Settings (Optional)</label>
                <div class="alert alert-info">
                    <small>You can configure detailed settings after registration.</small>
                </div>
            </div>
            
            <div class="mb-3">
                <button type="submit" class="btn btn-primary">Register Bot</button>
                <a href="/Admin/Bots" class="btn btn-secondary">Cancel</a>
            </div>
        </form>
    </div>
    
    <div class="col-md-6">
        <div class="card">
            <div class="card-header">
                <h5 class="mb-0">Registration Information</h5>
            </div>
            <div class="card-body">
                <p>After registering your bot, you will receive:</p>
                <ul>
                    <li><strong>Bot ID:</strong> Unique identifier for your bot</li>
                    <li><strong>API Key:</strong> Secret key for authentication (save this securely!)</li>
                    <li><strong>Configuration:</strong> Access to manage bot settings</li>
                </ul>
                
                <hr />
                
                <h6>Bot Types:</h6>
                <ul class="small">
                    <li><strong>Telegram:</strong> Telegram messenger bot</li>
                    <li><strong>Discord:</strong> Discord server bot</li>
                    <li><strong>WhatsApp:</strong> WhatsApp Business API</li>
                    <li><strong>Signal:</strong> Signal messenger bot</li>
                    <li><strong>Matrix:</strong> Matrix protocol bot</li>
                    <li><strong>IRC:</strong> Internet Relay Chat bot</li>
                    <li><strong>Custom:</strong> Custom implementation</li>
                </ul>
            </div>
        </div>
    </div>
</div>

@section Scripts {
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validate/1.19.5/jquery.validate.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery-validation-unobtrusive/3.2.12/jquery.validate.unobtrusive.min.js"></script>
}