UNPKG

@kiwicom/smart-faq

Version:

43 lines (36 loc) 1.08 kB
// @flow import * as React from 'react'; import Translate from '@kiwicom/nitro/lib/components/Translate'; import Stack from '@kiwicom/orbit-components/lib/Stack'; import TextLink from '@kiwicom/orbit-components/lib/TextLink'; import NewWindow from '@kiwicom/orbit-components/lib/icons/NewWindow'; import { LanguageContext } from '../../context/Language'; type Props = {| translationKey?: string, type?: 'primary' | 'secondary', justify?: 'start' | 'center', onClick?: () => void, |}; const Link = (props: Props) => { const language = React.useContext(LanguageContext); return ( <Stack flex justify={props.justify} spaceAfter="medium"> <TextLink external onClick={props.onClick} href={`/${language}/content/feedback`} type={props.type} size="normal" icon={<NewWindow />} dataTest="contactUs" > {props.translationKey ? ( <Translate t={props.translationKey} /> ) : ( 'Go to contact page.' )} </TextLink> </Stack> ); }; export default Link;