Submit
Path:
~
/
/
usr
/
share
/
grafana
/
public
/
app
/
features
/
auth-config
/
components
/
File Content:
ProviderCard.tsx
import React from 'react'; import { isIconName } from '@grafana/data'; import { Badge, Card, Icon } from '@grafana/ui'; import { UIMap } from '../constants'; import { getProviderUrl } from '../utils/url'; type Props = { providerId: string; enabled: boolean; configPath?: string; authType?: string; onClick?: () => void; }; export function ProviderCard({ providerId, enabled, configPath, authType, onClick }: Props) { //@ts-expect-error const url = getProviderUrl({ configPath, id: providerId }); const [iconName, displayName] = UIMap[providerId] || ['lock', providerId.toUpperCase()]; return ( <Card href={url} onClick={onClick}> <Card.Heading>{displayName}</Card.Heading> <Card.Meta>{authType}</Card.Meta> {isIconName(iconName) && ( <Card.Figure> <Icon name={iconName} size={'xxxl'} /> </Card.Figure> )} <Card.Actions> <Badge text={enabled ? 'Enabled' : 'Not enabled'} color={enabled ? 'green' : 'blue'} /> </Card.Actions> </Card> ); }
Submit
FILE
FOLDER
INFO
Name
Size
Permission
Action
ConfigureAuthCTA.tsx
1255 bytes
0644
ProviderCard.tsx
1039 bytes
0644
N4ST4R_ID | Naxtarrr