import { h } from '@stencil/core';
import { VegaSlimmer } from 'vega-slimmer/core';
import { VegaInternalIconManager } from '../../../../helpers/icon/internal-icon-manager';
import circleXmark from '../../../../global/icons/circle-xmark';
import circleCheckRegular from '../../../../global/icons/circle-check-regular';
/** renders file status for a file uploader component. */
export class VegaFileUploaderFileStatusRenderer extends VegaSlimmer {
  render(status, uploadingPercent) {
    switch (status) {
      case 'uploading':
        return (h("vega-loading-indicator", Object.assign({ class: "vega-file-list-status", mode: uploadingPercent ? 'determinate' : 'indeterminate', size: "micro" }, (uploadingPercent ? { percent: uploadingPercent } : {}))));
      case 'done':
        return (h("vega-icon", { class: "vega-file-list-status", color: "text-success", icon: VegaInternalIconManager.getIconKey('circle-check-regular') }));
      case 'error':
        return (h("vega-icon", { class: "vega-file-list-status", color: "text-error", icon: VegaInternalIconManager.getIconKey('circle-xmark') }));
      default:
        return (h("vega-loading-indicator", { class: "vega-file-list-status", mode: "determinate", size: "micro" }));
    }
  }
}
(() => {
  VegaInternalIconManager.register({
    'circle-check-regular': circleCheckRegular,
    'circle-xmark': circleXmark,
  });
})();
