// Copyright 2024 The Chromium Authors // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. import * as i18n from '../../../../core/i18n/i18n.js'; import * as Platform from '../../../../core/platform/platform.js'; import type {INPBreakdownInsightModel} from '../../../../models/trace/insights/INPBreakdown.js'; import * as Trace from '../../../../models/trace/trace.js'; import * as UI from '../../../../ui/legacy/legacy.js'; import * as Lit from '../../../../ui/lit/lit.js'; import {BaseInsightComponent} from './BaseInsightComponent.js'; import {Table} from './Table.js'; const {UIStrings, i18nString, createOverlaysForSubpart} = Trace.Insights.Models.INPBreakdown; const {html} = Lit; const {widgetConfig} = UI.Widget; export class INPBreakdown extends BaseInsightComponent { override internalName = 'inp'; protected override hasAskAiSupport(): boolean { return this.model?.longestInteractionEvent !== undefined; } override renderContent(): Lit.LitTemplate { const event = this.model?.longestInteractionEvent; if (!event) { return html`
${i18nString(UIStrings.noInteractions)}
`; } const time = (us: Trace.Types.Timing.Micro): string => i18n.TimeUtilities.millisToString(Platform.Timing.microSecondsToMilliSeconds(us)); // clang-format off return html`
${html` `}
`; // clang-format on } }