<commit_before><template lang="pug">
  ul.resources
    li(v-for="resource in filteredResources")
      span {{resource.name}}, {{resource.website}}, {{resource.location}}
</template>

<script>
  import resourceIndex from 'components/pool/resource-index';

  export default {
    computed: {
      filteredResources() {
        if (!this.filter) return this.resources;

        const res = resourceIndex.search(this.filter);

        return res.map(r => this.resources.filter(resource => resource.key === r.ref)[0]);
      },
    },
    vuex: {
      getters: {
        filter: state => state.pool.filter,
        resources: state => state.pool.resources,
      },
    },
  };
</script><commit_msg>Use component for rendering resources<commit_after><template lang="pug">
  ul.resources
    li(v-for="resource in filteredResources")
      resource(v-bind:resource="resource")
</template>

<script>
  import { index, booster } from 'components/pool/resource-index';
  import Resource from 'components/pool/resource';

  export default {
    computed: {
      filteredResources() {
        if (!this.filter) return this.resources;

        const res = index.search(this.filter, booster);

        return res.map(r => {
          for (let i = 0; i < this.resources.length; i++) {
            if (this.resources[i].key === r.ref) {
              return this.resources[i];
            }
          }
          return r;
        });
      },
    },
    vuex: {
      getters: {
        filter: state => state.pool.filter,
        resources: state => state.pool.resources,
      },
    },
    components: {
      Resource,
    },
  };
</script>
{'fraction_non_alphanumeric': 0.14678899082568808, 'fraction_numerical': 0.0012232415902140672, 'mean_word_length': 2.3524590163934427, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 18, 'https://': 0, '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': '114353', 'n_tokens_mistral': 479, 'n_tokens_neox': 468, 'n_words': 101}