'use client';

import useGlobalStore from '@/config/use-global';
import { useTranslations } from 'next-intl';
import Image from 'next/image';
import Link from 'next/link';

export default function FooterCopyright() {
  const { common } = useGlobalStore();
  const { site } = common;
  const t = useTranslations('auth');

  return (
    <footer className={'fixed bottom-6 z-50 w-full'}>
      <div className={'container relative flex justify-center text-right md:block'}>
        <Image
          src={'./logo.png'}
          height={37}
          width={28}
          className={`h-[37px] w-[28px] flex-shrink-0 object-contain md:absolute md:left-1/2 md:-translate-x-1/2`}
          alt='logo'
          unoptimized
        ></Image>
        <div className={'ml-2.5'}>
          <strong className='text-foreground'>{site.site_name}</strong> © All rights reserved.
          <div>
            <Link href='/tos' className='underline'>
              {t('tos')}
            </Link>
            <Link href='/privacy-policy' className='ml-2 underline'>
              {t('privacyPolicy')}
            </Link>
          </div>
        </div>
      </div>
    </footer>
  );
}
