<Overlay @onLoad={{this.setOverlayContext}} @onOpen={{this.onOpen}} @onClose={{this.onClose}} @onToggle={{this.onToggle}} @position="right" @noBackdrop={{true}} @fullHeight={{true}} @isResizable={{or this.isResizable @isResizable}} @width={{or this.width @width "570px"}}>
    <Overlay::Header @hideLeftSection={{true}} @actionsWrapperClass="flex-1 flex-col py-3" class="h-auto-i min-h-[127px]">
        <div class="flex flex-row items-center justify-between w-full mb-4">
            <div class="flex flex-1 space-x-2">
                <Button @type="default" @icon="pen" @helpText={{t "fleet-ops.component.contact-panel.edit-button"}} @onClick={{this.onEdit}} />
            </div>
            <div class="flex flex-1 justify-end">
                <Button @type="default" @icon="times" @helpText={{if this.contact.id (t "fleet-ops.component.contact-panel.cancel-edit-button")(t "fleet-ops.component.contact-panel.cancel-new-button") }} @onClick={{this.onPressCancel}} />
            </div>
        </div>
        <div class="flex flex-row justify-between w-full">
            <div class="flex flex-col flex-1 w-3/4">
                <div class="flex flex-row">
                    <div class="w-14 flex items-center justify-start">
                        <Image src={{this.contact.photo_url}} @fallbackSrc={{config "defaultValues.contactImage"}} alt={{this.contact.name}} height="48" width="48" class="h-12 w-12 rounded-lg shadow-sm" />
                        <Attach::Tooltip @class="clean" @animation="scale" @placement="top">
                            <InputInfo @text={{this.contact.public_id}} />
                        </Attach::Tooltip>
                    </div>
                    <div class="flex flex-col">
                        <h1 class="text-gray-900 dark:text-white text-2xl">{{this.contact.name}}</h1>
                        <div class="-mt-1">
                            <div class="flex flex-row items-center">
                                <span class="text-sm dark:text-blue-400 text-blue-600">{{smart-humanize this.contact.type}}</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="flex justify-end w-1/4">
                <Badge @status={{this.contact.public_id}} @type="info" @hideStatusDot={{true}} />
            </div>
        </div>
    </Overlay::Header>
    <Overlay::Body class="no-padding">
        <div class="section-header-actions w-full overflow-x-scroll lg:overflow-x-auto">
            <div class="ui-tabs mt-4">
                <nav>
                    {{#each this.tabs as |tab|}}
                        <a href="javascript:;" class="ui-tab {{if (eq this.tab.slug tab.slug) 'active'}}" {{on "click" (fn this.onTabChanged tab.slug)}}>
                            <FaIcon @icon={{tab.icon}} class="mr-1" />
                            <span>{{tab.title}}</span>
                        </a>
                    {{/each}}
                </nav>
            </div>
        </div>
        <div class="tab-content tab-{{this.tab.slug}}">
            {{component this.tab.component contact=this.contact tabOptions=this.tab options=this.tab.componentParams}}
        </div>
    </Overlay::Body>
</Overlay>