import { Component, inject } from '@angular/core';
import { RouterModule } from '@angular/router';
import { InventoryService } from '@c8y/client';
import { CellRendererContext, CommonModule, DeviceStatusModule } from '@c8y/ngx-components';
import * as i0 from "@angular/core";
import * as i1 from "@c8y/ngx-components";
import * as i2 from "@angular/router";
export class DeviceCellRendererComponent {
    constructor(context) {
        this.context = context;
        this.inventoryService = inject(InventoryService);
    }
    async ngOnInit() {
        this.device = (await this.inventoryService.detail(this.context.item.deviceId))?.data;
    }
    static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DeviceCellRendererComponent, deps: [{ token: i1.CellRendererContext }], target: i0.ɵɵFactoryTarget.Component }); }
    static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "18.2.9", type: DeviceCellRendererComponent, isStandalone: true, selector: "c8y-operation-device-cell-renderer", ngImport: i0, template: `
    <span class="m-r-4">
      <device-status [mo]="device || {}"></device-status>
    </span>
    <a
      class="interact"
      [title]="context.item.deviceName"
      [routerLink]="['/device', context.item.deviceId, 'device-info']"
    >
      {{ context.item.deviceName }}
    </a>
  `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "ngmodule", type: DeviceStatusModule }, { kind: "component", type: i1.DeviceStatusComponent, selector: "device-status, c8y-device-status", inputs: ["mo", "size"] }] }); }
}
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.9", ngImport: i0, type: DeviceCellRendererComponent, decorators: [{
            type: Component,
            args: [{
                    template: `
    <span class="m-r-4">
      <device-status [mo]="device || {}"></device-status>
    </span>
    <a
      class="interact"
      [title]="context.item.deviceName"
      [routerLink]="['/device', context.item.deviceId, 'device-info']"
    >
      {{ context.item.deviceName }}
    </a>
  `,
                    selector: 'c8y-operation-device-cell-renderer',
                    standalone: true,
                    imports: [CommonModule, RouterModule, DeviceStatusModule]
                }]
        }], ctorParameters: () => [{ type: i1.CellRendererContext }] });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGV2aWNlLmNlbGwtcmVuZGVyZXIuY29tcG9uZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vLi4vb3BlcmF0aW9ucy9ncmlkLWNvbHVtbnMvZGV2aWNlLmNlbGwtcmVuZGVyZXIuY29tcG9uZW50LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSxFQUFVLE1BQU0sZUFBZSxDQUFDO0FBQzFELE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUMvQyxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFDL0MsT0FBTyxFQUFFLG1CQUFtQixFQUFFLFlBQVksRUFBRSxrQkFBa0IsRUFBRSxNQUFNLHFCQUFxQixDQUFDOzs7O0FBb0I1RixNQUFNLE9BQU8sMkJBQTJCO0lBS3RDLFlBQW1CLE9BQTRCO1FBQTVCLFlBQU8sR0FBUCxPQUFPLENBQXFCO1FBRnZDLHFCQUFnQixHQUFHLE1BQU0sQ0FBQyxnQkFBZ0IsQ0FBQyxDQUFDO0lBRUYsQ0FBQztJQUVuRCxLQUFLLENBQUMsUUFBUTtRQUNaLElBQUksQ0FBQyxNQUFNLEdBQUcsQ0FBQyxNQUFNLElBQUksQ0FBQyxnQkFBZ0IsQ0FBQyxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxJQUFJLENBQUMsUUFBUSxDQUFDLENBQUMsRUFBRSxJQUFJLENBQUM7SUFDdkYsQ0FBQzs4R0FUVSwyQkFB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