import type { Meta, StoryObj } from '@storybook/react';
import { AllLoadsFilter } from '../components/AllLoadsComponent/AllLoadsFilter';
import { truckTypesData } from '../mock/truckTypes';
import { regionWiseBranches } from '../mock/regionWiseBranches';
import React from 'react';
import { FilterSvg } from '../assets/svg/FilterSvg';

const meta: Meta<typeof AllLoadsFilter> = {
    title: 'Example/AllLoads/AllLoadsFilter',
    component: AllLoadsFilter,
    tags: ['autodocs']
  };
  
  export default meta;
  type Story = StoryObj<typeof AllLoadsFilter>;
  
  export const AllLoadsFilterModal: Story = {
      args: {
        icon: <div style={{display: "flex", justifyContent: "end", width: "100%"}}><FilterSvg/></div>,
        truckTypes: truckTypesData,
        regions: regionWiseBranches, 
        multiSelect: true,
        lang: 'en',
        truckTypeCallback: (truckTypeIds: Array<number>)=> {console.log({truckTypeIds})},
        branchCallback: (branchIds: Array<number>) => {console.log({branchIds})},
        onReset: () => {console.log("reset clicked")}, 
        onShowResult: () => {console.log("show results clicked")},
        translatedWords: {
          translatedFilter: "Filter",
          translatedTruckTypes: "Truck Types",
          translatedCities: "Cities",
          translatedReset: "Reset",
          translatedShowResult: "Show Result"
        }    
    }
  };