import React from 'react'

const redirectFormPage = () => {
  const url = 'https://wppool.dev/docs/how-to-enable-the-pdo-sqlite-extension-in-your-servers-php-configuration/'
  window.open(url, '_blank')
}

const NoticeBar = () => {
  return (
    <div className='arcm-w-full arcm-bg-[#FFF7ED] arcm-border-b arcm-border-gray-200 arcm-mb-[20px]'>
      <div className='arcm-max-w-screen-xl arcm-mx-auto arcm-px-4 arcm-py-2'>
        <div className='arcm-flex arcm-items-center arcm-justify-center arcm-gap-2 arcm-text-sm arcm-text-gray-700'>
          <svg
            width='16'
            height='16'
            viewBox='0 0 16 16'
            fill='none'
            xmlns='http://www.w3.org/2000/svg'
          >
            <path
              fill-rule='evenodd'
              clip-rule='evenodd'
              d='M16 8C16 3.5816 12.4184 0 8 0C3.5816 0 0 3.5816 0 8C0 12.4184 3.5816 16 8 16C12.4184 16 16 12.4184 16 8ZM8 4C8.21217 4 8.41566 4.08429 8.56569 4.23431C8.71571 4.38434 8.8 4.58783 8.8 4.8V8.8C8.8 9.01217 8.71571 9.21566 8.56569 9.36569C8.41566 9.51571 8.21217 9.6 8 9.6C7.78783 9.6 7.58434 9.51571 7.43431 9.36569C7.28429 9.21566 7.2 9.01217 7.2 8.8V4.8C7.2 4.58783 7.28429 4.38434 7.43431 4.23431C7.58434 4.08429 7.78783 4 8 4ZM7.2 11.2C7.2 10.9878 7.28429 10.7843 7.43431 10.6343C7.58434 10.4843 7.78783 10.4 8 10.4H8.0064C8.21857 10.4 8.42206 10.4843 8.57209 10.6343C8.72211 10.7843 8.8064 10.9878 8.8064 11.2C8.8064 11.4122 8.72211 11.6157 8.57209 11.7657C8.42206 11.9157 8.21857 12 8.0064 12H8C7.78783 12 7.58434 11.9157 7.43431 11.7657C7.28429 11.6157 7.2 11.4122 7.2 11.2Z'
              fill='#F97316'
            />
          </svg>

          <span>Archiving may not work correctly because the PDO SQLite extension is not enabled on your server.</span>
          <button
            onClick={redirectFormPage}
            className='arcm-text-blue-600 arcm-font-medium hover:arcm-text-blue-700'
          >
            Learn how to fix this
          </button>
        </div>
      </div>
    </div>
  )
}

export default NoticeBar
