2019-10-03 23:40:54 +02:00
|
|
|
// @flow
|
|
|
|
import * as ICONS from 'constants/icons';
|
|
|
|
import React from 'react';
|
|
|
|
import Button from 'component/button';
|
|
|
|
|
|
|
|
type Props = {
|
2020-02-21 18:23:04 +01:00
|
|
|
href?: string,
|
|
|
|
navigate?: string,
|
2020-07-24 20:00:17 +02:00
|
|
|
icon?: string,
|
2022-03-15 20:07:31 +01:00
|
|
|
iconSize?: number,
|
2020-07-24 20:00:17 +02:00
|
|
|
description?: string,
|
2019-10-03 23:40:54 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
export default function HelpLink(props: Props) {
|
2022-03-15 20:07:31 +01:00
|
|
|
const { href, navigate, icon, iconSize, description } = props;
|
2020-07-24 20:00:17 +02:00
|
|
|
return (
|
|
|
|
<Button
|
2022-03-15 20:07:31 +01:00
|
|
|
onClick={(e) => {
|
2020-10-12 23:32:46 +02:00
|
|
|
if (href) {
|
|
|
|
e.stopPropagation();
|
|
|
|
}
|
|
|
|
}}
|
2020-07-24 20:00:17 +02:00
|
|
|
className="icon--help"
|
|
|
|
icon={icon || ICONS.HELP}
|
2022-03-15 20:07:31 +01:00
|
|
|
iconSize={iconSize || 14}
|
|
|
|
title={description || __('Help')}
|
2020-07-24 20:00:17 +02:00
|
|
|
description={description || __('Help')}
|
|
|
|
href={href}
|
|
|
|
navigate={navigate}
|
|
|
|
/>
|
|
|
|
);
|
2019-10-03 23:40:54 +02:00
|
|
|
}
|