import { ActionIcon } from '@mantine/core';
import { IconMenu2 } from '@tabler/icons-react';

import { useGridlerStore } from './GridlerStore';

export function GridlerRightMenuIcon() {
  const { loadingData, onContextClick } = useGridlerStore((s) => ({
    loadingData: s.loadingData,
    onContextClick: s.onContextClick,
  }));

  return (
    <ActionIcon
      loading={loadingData}
      mr="xs"
      mt="2px"
      onClick={(e) => onContextClick('menu', e as any)}
      variant="subtle"
    >
      <IconMenu2 />
    </ActionIcon>
  );
}
