"use client"

import { Button as ButtonRAC } from "react-aria-components"
import { useIntl } from "react-intl"

import { ArrowUpIcon } from "@/components/Icons"

import styles from "./backToTopButton.module.css"

export function BackToTopButton({ onClick }: { onClick: () => void }) {
  const intl = useIntl()
  return (
    <ButtonRAC className={styles.backToTopButton} onPress={onClick}>
      <ArrowUpIcon color="burgundy" />
      <span className={styles.backToTopButtonText}>
        {intl.formatMessage({ id: "Back to top" })}
      </span>
    </ButtonRAC>
  )
}
