/*
 * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
 * SPDX-License-Identifier: Apache-2.0
 */
/************************************************************************
                            DISCLAIMER
This is just a playground package. It does not comply with best practices
of using AWS-UI components. For production code, follow the integration
guidelines:
https://polaris.a2z.com/develop/integration/react/
************************************************************************/
import React, { useState } from 'react';
import {
  Box,
  Button,
  CollectionPreferences,
  Pagination,
  TextFilter,
  Table
} from '@awsui/components-react';
 import {
  PAGE_SELECTOR_OPTIONS,
  DEFAULT_PREFERENCES, getColumnDefinitions, getContentSelectorOptions
} from '../resources/intakeform-table-config.jsx';
import { useCollection } from '@awsui/collection-hooks';
import TableHeader from './TableHeader.jsx';
const IntakeFormTable = (props) => {
  const locaStorageKeys = {
    tablePrefs: "Intake_Import_Table_Prefs",
    tableAttributes: "Intake_Import_Table_Atrributes"
  }
  const [preferences, setPreferences] = useState(DEFAULT_PREFERENCES);
  React.useEffect(() => {
    localStorage.setItem(locaStorageKeys.tablePrefs, JSON.stringify(preferences));
  }, [preferences]);
  const { items, actions, collectionProps, filterProps, paginationProps, filteredItemsCount } = useCollection(
    props.items,
    {
      pagination: { pageSize: preferences.pageSize },
      sorting: {},
      filtering: {
        noMatch: (