import Background from 'Elements/layout/Background';
import Tabs from 'Elements/layout/Tabs';
import styled from 'styled-components';
import { min } from 'UIKit/mq';
import AddProduct from './AddProduct';
import CreateKP from './CreateKP';
import Insurance from './Insurance';
import Leasing from './Leasing';
import LeasingObject from './LeasingObject';
import Payments from './Payments';
import SupplierAgent from './SupplierAgent';

const formTabs = [Leasing, Payments, LeasingObject, SupplierAgent, Insurance, AddProduct, CreateKP];

const Wrapper = styled(Background)`
  padding: 4px 10px;

  ${min('laptop')} {
    padding: 4px 18px 10px;
  }
`;

function Form() {
  return (
    <Wrapper>
      <Tabs type="card" tabBarGutter="5px">
        {formTabs.map(({ id, title, Component }) => (
          <Tabs.TabPane tab={title} key={id}>
            <Component />
          </Tabs.TabPane>
        ))}
      </Tabs>
    </Wrapper>
  );
}

export default Form;
