// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: Apache-2.0 import React, { useState } from 'react'; import Flex from '../../Flex'; import InfiniteList from './'; export default { title: 'UI Components/Chat/InfiniteList', component: InfiniteList, }; export const BasicInfiniteList = () => { // All of the below code is just to fake an API call that would return a new batch of messages const [batchNumber, setBatchNumber] = useState(2); const numberOfBatches = 5; const batchSize = 50; const createBatch = (batchNum) => { if (batchNum <= numberOfBatches) { const batch: JSX.Element[] = []; for (let i = 1; i <= batchSize; i++) { batch.push(