import Seo from '@/core/components/Seo'
import Link from '@/core/components/elements/Link/Link'
import BasicLayout from '@/core/components/layouts/BasicLayout'
import useAuth from '@/core/hooks/useAuth'
import IsAuth from '@/lib/auth/components/IsAuth'
import { EnvelopeIcon } from '@heroicons/react/24/outline'
import { useRouter } from 'next/router'

export default function FinishQuotation() {
  const auth = useAuth()
  const router = useRouter()
  const { id } = router.query
  return (
    <>
      <Seo title='Quotation Indoteknik.com' />

      <IsAuth>
        <BasicLayout>
          <div className='mx-auto container'>
            <div className='m-4 md:m-0 md:mt-10 px-4 py-6 shadow-md border border-gray_r-3'>
              <div className='flex'>
                <span className='p-3 mx-auto bg-warning-100 border border-warning-300 rounded'>
                  <EnvelopeIcon className='w-8 text-warning-800' />
                </span>
              </div>
              <p className='h2 text-center mt-6'>Terima Kasih {auth?.name}</p>
              <p className='text-center mt-3 leading-6 text-gray_r-11'>
                Penawaran harga kamu di Indoteknik.com berhasil dikirimkan, tim kami akan segera
                menghubungi anda.
              </p>
              {id && (
                <Link
                  href={`/my/transaction/${id}`}
                  className='btn-yellow !text-gray_r-12 mt-6 w-full md:w-1/3 md:mx-auto'
                >
                  Lihat Penawaran
                </Link>
              )}
              <Link href='/' className='btn-light !text-gray_r-12 mt-2 w-full md:w-1/3 md:mx-auto'>
                Ke Halaman Utama
              </Link>
            </div>
          </div>
        </BasicLayout>
      </IsAuth>
    </>
  )
}
