import Stack from '@material-hu/mui/Stack';

import FilterChips from '../../../components/Filters/ChipsList';
import SearchBar from '../../../components/Filters/SearchBar';
import { JourneyAssignee } from '../../../types/task';

import { Collaborators } from './Collaborators';

type TasksFiltersProps = {
  hidePillFilters?: boolean;
  isUserTasksModule?: boolean;
  collaborators: JourneyAssignee[];
};

const TasksFilters = ({
  collaborators,
  hidePillFilters = false,
  isUserTasksModule = false,
}: TasksFiltersProps) => {
  return (
    <>
      <Stack sx={{ flexDirection: 'row', gap: 1, alignItems: 'center' }}>
        <SearchBar />
        <Collaborators
          isUserTasksModule={isUserTasksModule}
          collaborators={collaborators}
        />
        {!isUserTasksModule && (
          <FilterChips
            isTasks
            hidePillFilters={hidePillFilters}
          />
        )}
      </Stack>
    </>
  );
};

export default TasksFilters;
