<div class="flex-1">
    <ContentPanel @title={{t "registry-bridge.developers.extensions.extension-form.bundles"}} @open={{true}} @wrapperClass="bordered-classic">
        <div class="px-4 pb-4 pt-2">
            <div>
                <FileUpload
                    @name={{t "registry-bridge.developers.extensions.extension-form.upload-new-bundle"}}
                    @accept={{join "," this.acceptedBundleTypes}}
                    @onFileAdded={{perform this.uploadBundle}}
                    as |queue|
                >
                    <a tabindex={{0}} class="flex items-center px-0 mt-2 text-xs no-underline truncate btn btn-sm btn-default" disabled={{not queue.files.length}}>
                        {{#if queue.files.length}}
                            <div class="mr-1.5">
                                <Spinner />
                            </div>
                            <span>
                                {{t "common.uploading"}}
                            </span>
                        {{else}}
                            <FaIcon @icon="box-archive" class="mr-1.5" />
                            <span>
                                {{t "registry-bridge.developers.extensions.extension-form.upload-new-bundle"}}
                            </span>
                        {{/if}}
                    </a>
                </FileUpload>
            </div>
            {{#unless this.createBundle.isIdle}}
                <div class="flex flex-row items-center mt-4">
                    <Spinner @wrapperClass="flex flex-row items-center space-x-2" @loadingMessage="Creating a new bundle..." />
                </div>
            {{/unless}}
            {{#if this.lastError}}
                <div class="flex flex-row items-center mt-4 rounded-lg shadow-sm bg-red-100 border-red-200 text-red-900 px-4 py-2 text-xs">
                    <FaIcon @icon="triangle-exclamation" @size="sm" class="text-red-800" />
                    <span class="ml-2">{{this.lastError}}</span>
                </div>
            {{/if}}
        </div>
        {{#if @model.length}}
            <div class="next-table-wrapper auto-height">
                <table>
                    <thead>
                        <tr>
                            <th {{set-width "175px"}}>ID</th>
                            <th {{set-width "145px"}}>Filename</th>
                            <th {{set-width "80px"}}>Bundle</th>
                            <th {{set-width "80px"}}>Version</th>
                            <th {{set-width "165px"}}>Date Uploaded</th>
                            <th>Status</th>
                        </tr>
                    </thead>
                    <tbody>
                        {{#each @model as |bundle|}}
                            <tr>
                                <td>{{bundle.bundle_id}}</td>
                                <td>{{bundle.bundle_filename}}</td>
                                <td>{{bundle.bundle_number}}</td>
                                <td>{{bundle.version}}</td>
                                <td>{{bundle.createdAt}}</td>
                                <td>
                                    <Badge @status={{bundle.status}} />
                                </td>
                            </tr>
                        {{/each}}
                    </tbody>
                </table>
            </div>
        {{/if}}
    </ContentPanel>
</div>