import { Anchor, AnchorProps } from '@tidbcloud/uikit'

interface LinkProps extends AnchorProps {
  text?: string
  link?: string
}

const GithubDocument = ({ text, link, ...rest }: LinkProps) => {
  return (
    <Anchor
      sx={(theme) => ({
        color: theme.colors.peacock[7],
        fontWeight: 600
      })}
      {...rest}
      target="_blank"
      href={link || 'https://docs.pingcap.com/tidbcloud/data-service-manage-github-connection'}
      data-mp-event="Dataservice document link clicked"
    >
      {text || 'document'}
    </Anchor>
  )
}

export default GithubDocument
