/** * Copyright (c) OpenLens Authors. All rights reserved. * Licensed under MIT License. See LICENSE in root directory for more information. */ import React, { useState } from "react"; import type { HelmChart } from "../../k8s/helm-chart"; export interface HelmChartIconProps { className?: string; chart: HelmChart; } export const HelmChartIcon = ({ chart, className, }: HelmChartIconProps) => { const [failedToLoad, setFailedToLoad] = useState(false); const icon = chart.getIcon(); if (!icon || failedToLoad) { return (
); } return ( evt.currentTarget.classList.add("visible")} onError={() => setFailedToLoad(true)} /> ); };