frontend-plugin-api: accept IconElement in AuthProviderInfo

Update the `icon` field on `AuthProviderInfo` to accept `IconElement`
in addition to `IconComponent`, and update consumers in core-components
and user-settings to handle both types at runtime.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
This commit is contained in:
Patrik Oldsberg
2026-03-16 11:07:36 +01:00
parent 722ce6f54c
commit e26e3de81e
8 changed files with 44 additions and 15 deletions
+1 -1
View File
@@ -316,7 +316,7 @@ export const atlassianAuthApiRef: ApiRef<
export type AuthProviderInfo = {
id: string;
title: string;
icon: IconComponent;
icon: IconComponent | IconElement;
message?: string;
};
@@ -17,7 +17,7 @@
/* eslint-disable @typescript-eslint/no-redeclare */
import { ApiRef, createApiRef } from '../system';
import { IconComponent } from '../../icons/types';
import { IconComponent, IconElement } from '../../icons/types';
import { Observable } from '@backstage/types';
/**
@@ -54,8 +54,13 @@ export type AuthProviderInfo = {
/**
* Icon for the auth provider.
*
* @remarks
*
* Accepts either an `IconElement` (e.g. `<MyIcon />`) or an `IconComponent`
* (e.g. `MyIcon`). Prefer passing `IconElement`.
*/
icon: IconComponent;
icon: IconComponent | IconElement;
/**
* Optional user friendly messaage to display for the auth provider.