<commit_before>import { Component, Prop, h } from '@stencil/core';

@Component({
  tag: 'hubspot-dynamic-content',
  styleUrl: 'hubspot-dynamic-content.scss',
  shadow: false
})
export class HubspotDynamicContent {

  @Prop() listId: string = 'default';

  componentWillLoad() {
    const hsutk = window['getCookie']('hubspotutk');

    fetch(`/api/v1/hsconverted/${this.listId}/${hsutk}`)
      .then(response => response.json())
      .then(data => console.log(data));
  }

  render() {
    return ([
      <slot name="default" />,
      <slot name="alternate" />
    ]);
  }
}<commit_msg>adjusting dynamic content to work for Zeit API<commit_after>import { Component, Prop, h } from '@stencil/core';

@Component({
  tag: 'hubspot-dynamic-content',
  styleUrl: 'hubspot-dynamic-content.scss',
  shadow: false
})
export class HubspotDynamicContent {

  @Prop() listId: string = 'default';
  isInList = false;

  API_URL = 'https://ionic-site-new.now.sh/api/hubspot/hasconverted';

  componentWillLoad() {
    const hsutk = window['getCookie']('hubspotutk');

    fetch(`${this.API_URL}?listId=${this.listId}&hsutk=${hsutk}`)
      .then(response => response.json())
      .then(data => {
        this.isInList = data;
        console.log(this.isInList);
      });
  }

  render() {
    return ([
      <div style={{display: this.isInList ? 'none' : 'block'}}>
        <slot name="default" />
      </div>,
      <div style={{display: this.isInList ?  'block' : 'none'}}>
        <slot name="alternate" />
      </div>
    ]);
  }
}
{'fraction_non_alphanumeric': 0.18407310704960836, 'fraction_numerical': 0.0006527415143603133, 'mean_word_length': 3.234806629834254, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 15, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '832492', 'n_tokens_mistral': 535, 'n_tokens_neox': 523, 'n_words': 95}