import { P as t } from "../../../../packageName-CJwD6mUt.js";
const e = `
import { DataTable, ColumnActionState } from '${t}';
import { useState } from 'react';

const App = () => {
  const [data, setData] = useState(() => getMockData(20));
  const [isLoading, setIsLoading] = useState(false);
  const [page, setPage] = useState(1);

  const columns = [...]; // Column definitions

  const handleScrollEnd = () => {
    // Prevent multiple simultaneous loading requests
    if (isLoading || page >= 5) return;

    setIsLoading(true);
    
    // In a real app, make an API call here
    setTimeout(() => {
      const newData = [...data, ...getMockData(10)];
      setData(newData);
      setIsLoading(false);
      setPage(prev => prev + 1);
    }, 1000);
  };

  return (
    <DataTable
      dataSource={data}
      columns={columns}
      tableHeight={400}
      onScrollEnd={handleScrollEnd}
      isLoading={isLoading}
      toolbar={{
        title: 'Infinite Scroll Demo',
        subtitle: \`\${data.length} items loaded (scroll to bottom to load more)\`,
      }}
    />
  );
};
`;
export {
  e as default
};
//# sourceMappingURL=scrollEndSource.js.map
