<commit_before>import React from 'react';
import { storiesOf } from '@storybook/react';
import { connectHits } from 'react-instantsearch-core';
import {
  QueryRuleCustomData,
  QueryRuleContext,
  Highlight,
  RefinementList,
} from 'react-instantsearch-dom';
import { WrapWithHits } from './util';

type CustomDataItem = {
  title: string;
  banner: string;
  link: string;
};

type MovieHit = {
  actors: string[];
  color: string;
  genre: string[];
  image: string;
  objectID: string;
  score: number;
  title: string;
};

const stories = storiesOf('QueryRuleContext', module);

const StoryHits = connectHits(({ hits }: { hits: MovieHit[] }) => (
  <div className="hits">
    {hits.map(hit => (
      <div key={hit.objectID} className="hit">
        <div className="hit-picture">
          <img src={hit.image} />
        </div>

        <div className="hit-content">
          <div>
            <Highlight attribute="title" hit={hit} />
          </div>
        </div>
      </div>
    ))}
  </div>
));

const storyProps = {
  appId: 'latency',
  apiKey: '<KEY>',
  indexName: 'instant_search_movies',
  linkedStoryGroup: 'QueryRuleCustomData.stories.tsx',
  hitsElement: <StoryHits />,
};

stories
  .add('default', () => (
    <WrapWithHits {...storyProps}>
      <ul>
        <li>
          On empty query, select the &quot;Drama&quot; category and The
          Shawshank Redemption appears
        </li>
        <li>
          On empty query, select the &quot;Thriller&quot; category and Pulp
          Fiction appears
        </li>
        <li>
          Type <q>music</q> and a banner will appear
        </li>
      </ul>

      <div style={{ display: 'flex' }}>
        <aside style={{ flex: 1 }}>
          <RefinementList attribute="genre" />
        </aside><commit_msg>chore(stories): correct linkedStoryGroup for QueryRuleContext<commit_after>import React from 'react';
import { storiesOf } from '@storybook/react';
import { connectHits } from 'react-instantsearch-core';
import {
  QueryRuleCustomData,
  QueryRuleContext,
  Highlight,
  RefinementList,
} from 'react-instantsearch-dom';
import { WrapWithHits } from './util';

type CustomDataItem = {
  title: string;
  banner: string;
  link: string;
};

type MovieHit = {
  actors: string[];
  color: string;
  genre: string[];
  image: string;
  objectID: string;
  score: number;
  title: string;
};

const stories = storiesOf('QueryRuleContext', module);

const StoryHits = connectHits(({ hits }: { hits: MovieHit[] }) => (
  <div className="hits">
    {hits.map(hit => (
      <div key={hit.objectID} className="hit">
        <div className="hit-picture">
          <img src={hit.image} />
        </div>

        <div className="hit-content">
          <div>
            <Highlight attribute="title" hit={hit} />
          </div>
        </div>
      </div>
    ))}
  </div>
));

const storyProps = {
  appId: 'latency',
  apiKey: '<KEY>',
  indexName: 'instant_search_movies',
  linkedStoryGroup: 'QueryRuleContext.stories.tsx',
  hitsElement: <StoryHits />,
};

stories
  .add('default', () => (
    <WrapWithHits {...storyProps}>
      <ul>
        <li>
          On empty query, select the &quot;Drama&quot; category and The
          Shawshank Redemption appears
        </li>
        <li>
          On empty query, select the &quot;Thriller&quot; category and Pulp
          Fiction appears
        </li>
        <li>
          Type <q>music</q> and a banner will appear
        </li>
      </ul>

      <div style={{ display: 'flex' }}>
        <aside style={{ flex: 1 }}>
          <RefinementList attribute="genre" />
        </aside>
{'fraction_non_alphanumeric': 0.15042782224675683, 'fraction_numerical': 0.0005520287054926856, 'mean_word_length': 2.5774925962487663, 'pattern_counts': {'":': 0, '<': 61, '<?xml version=': 0, '>': 67, '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': '1349914', 'n_tokens_mistral': 1183, 'n_tokens_neox': 1167, 'n_words': 289}