<commit_before>/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */
import { text } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import styled from 'styled-components';
import { FlagsProvider } from 'flagged';

/**
 * Internal dependencies
 */
import { Layout, ToastProvider } from '../../../../../components';
import {
  STORY_SORT_OPTIONS,
  SORT_DIRECTION,
  VIEW_STYLE,
  STORY_STATUS,
} from '../../../../../constants';
import {
  fillerDateSettingsObject,
  formattedStoriesArray,
  formattedUsersObject,
  STORYBOOK_PAGE_SIZE,
} from '../../../../../storybookUtils';
import Content from '../';
import { usePagePreviewSize } from '../../../../../utils';
import StoriesView from '../storiesView';
import EmptyView from '../emptyView';

export default {
  title: 'Dashboard/Views/MyStories/Content',
  component: Content,
};

const filter = {
  status: 'all',
  value: STORY_STATUS.ALL,
  set: action('set filter'),
};
const sort = {
  value: STORY_SORT_OPTIONS.NAME,
  set: action('set sort'),
  direction: SORT_DIRECTION.ASC,
  setDirection: action('set sort direction'),
};
const search = {
  keyword: '',
  setKeyword: action('set search'),
};
const view = {
  style: VIEW_STYLE.GRID,
  toggleStyle: action('toggle view style'),
  pageSize: STORYBOOK_PAGE_SIZE,
};
const page = {
  value: 1,
  set: action('set page number'),
  requestNextPage: action('request next page clicked'),
};

const storyActions = {
  createTemplateFromStory: action('create template from story clicked'),
  duplicateStory: action('duplicate story clicked'),
  trashStory: action('trash story clicked'),
  updateStory: action('update story clicked'),
  handlePreviewStory: action('handle preview story selected'),
};

const defaultProps = {
  allPagesFetched: false,
  filter: filter,
  isLoading: false,
  page: page,
  search: search,
  sort: sort,
  stories: formattedStoriesArray
    .concat(formattedStoriesArray)
    .concat(formattedStoriesArray),
  storyActions: storyActions,
  users: formattedUsersObject,
  view: view,
};

const StorybookLayoutContainer = styled.div`
  margin-top: 40px;
  height: 100vh;
`;
export const _default = () => {
  const { pageSize } = usePagePreviewSize({
    isGrid: true,
  });

  return (
    <FlagsProvider features={{ enableInProgressStoryActions: false }}>
      <ToastProvider>
        <Layout.Provider><commit_msg>make it clearer why concat stories in storybook<commit_after>/*
 * Copyright 2020 Google LLC
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     https://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/**
 * External dependencies
 */
import { text } from '@storybook/addon-knobs';
import { action } from '@storybook/addon-actions';
import styled from 'styled-components';
import { FlagsProvider } from 'flagged';

/**
 * Internal dependencies
 */
import { Layout, ToastProvider } from '../../../../../components';
import {
  STORY_SORT_OPTIONS,
  SORT_DIRECTION,
  VIEW_STYLE,
  STORY_STATUS,
} from '../../../../../constants';
import {
  fillerDateSettingsObject,
  formattedStoriesArray,
  formattedUsersObject,
  STORYBOOK_PAGE_SIZE,
} from '../../../../../storybookUtils';
import Content from '../';
import { usePagePreviewSize } from '../../../../../utils';
import StoriesView from '../storiesView';
import EmptyView from '../emptyView';

export default {
  title: 'Dashboard/Views/MyStories/Content',
  component: Content,
};

const filter = {
  status: 'all',
  value: STORY_STATUS.ALL,
  set: action('set filter'),
};
const sort = {
  value: STORY_SORT_OPTIONS.NAME,
  set: action('set sort'),
  direction: SORT_DIRECTION.ASC,
  setDirection: action('set sort direction'),
};
const search = {
  keyword: '',
  setKeyword: action('set search'),
};
const view = {
  style: VIEW_STYLE.GRID,
  toggleStyle: action('toggle view style'),
  pageSize: STORYBOOK_PAGE_SIZE,
};
const page = {
  value: 1,
  set: action('set page number'),
  requestNextPage: action('request next page clicked'),
};

const storyActions = {
  createTemplateFromStory: action('create template from story clicked'),
  duplicateStory: action('duplicate story clicked'),
  trashStory: action('trash story clicked'),
  updateStory: action('update story clicked'),
  handlePreviewStory: action('handle preview story selected'),
};

const longerListOfStories = formattedStoriesArray
  .concat(formattedStoriesArray)
  .concat(formattedStoriesArray);

const defaultProps = {
  allPagesFetched: false,
  filter: filter,
  isLoading: false,
  page: page,
  search: search,
  sort: sort,
  stories: longerListOfStories,
  storyActions: storyActions,
  users: formattedUsersObject,
  view: view,
};

const StorybookLayoutContainer = styled.div`
  margin-top: 40px;
  height: 100vh;
`;
export const _default = () => {
  const { pageSize } = usePagePreviewSize({
    isGrid: true,
  });

  return (
    <FlagsProvider features={{ enableInProgressStoryActions: false }}>
      <ToastProvider>
        <Layout.Provider>
{'fraction_non_alphanumeric': 0.1304202801867912, 'fraction_numerical': 0.004669779853235491, 'mean_word_length': 4.05223251895535, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 11, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '3522428', 'n_tokens_mistral': 1789, 'n_tokens_neox': 1759, 'n_words': 539}