import styled from 'styled-components/macro'

import { useLexicsStore } from 'features/LexicsStore'
import type { LexicsId, Values } from 'features/LexicsStore/types'

const Text = styled.span``

type Props = {
  className?: string,
  onClick?: () => void,
  t: LexicsId,
  values?: Values,
}

export const T9n = ({
  className,
  onClick,
  t,
  values,
}: Props) => {
  const { translate } = useLexicsStore()

  return (
    <Text
      onClick={onClick}
      className={className}
    >
      {translate(String(t), values)}
    </Text>
  )
}
