2025-04-01 10:38:02 +09:00

25 lines
573 B
TypeScript

import { 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>
);
};