mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
25 lines
580 B
TypeScript
25 lines
580 B
TypeScript
import React, { ReactNode } from 'react';
|
|
|
|
import { Stack, Text, TextLink } from '@grafana/ui';
|
|
|
|
interface Props {
|
|
children: NonNullable<ReactNode>;
|
|
title: string;
|
|
linkTitle?: string;
|
|
linkHref?: string;
|
|
}
|
|
|
|
export const InfoItem = ({ children, title, linkHref, linkTitle }: Props) => {
|
|
return (
|
|
<Stack gap={2} direction="column">
|
|
<Text element="h4">{title}</Text>
|
|
<Text color="secondary">{children}</Text>
|
|
{linkHref && (
|
|
<TextLink href={linkHref} external>
|
|
{linkTitle ?? linkHref}
|
|
</TextLink>
|
|
)}
|
|
</Stack>
|
|
);
|
|
};
|