---
import 'vanilla-cookieconsent/dist/cookieconsent.css';
import '../assets/styles/ccElegantBlack.css';
---

<!--<button type="button" class="cc-button">Show preferences modal</button>-->
<script>
  import { run } from 'vanilla-cookieconsent';
  import { config } from './CookieConsentConfig';

  // toggle custom black theme
  document.body.classList.add('cc--elegant-black');

  function checkCookieConsent() {
    const consentStatus = localStorage.getItem('cookie-accepted');
    return consentStatus === 'true';
  }

  // If consent is not given, run the cookie consent config
  if (!checkCookieConsent()) {
    run(config);
  }
</script>
