import { type FC } from 'react';

import { IconCalendarShare } from '@material-hu/icons/tabler';
import IconButton from '@material-hu/mui/IconButton';

import HuTooltip from '@material-hu/components/design-system/Tooltip';

import { useLokaliseTranslation as useTranslation } from 'src/utils/i18n';

type SchedulePostButtonProps = {
  disabled: boolean;
  onClick: () => void;
};

const SchedulePostButton: FC<SchedulePostButtonProps> = props => {
  const { disabled, onClick } = props;
  const { t } = useTranslation('post');
  return (
    <HuTooltip
      direction="bottom"
      title={t('post:schedule_post_web')}
    >
      <span style={{ display: 'flex' }}>
        <IconButton
          sx={{
            px: 2,
            height: '100%',
          }}
          variant="secondary"
          disabled={disabled}
          onClick={onClick}
        >
          <IconCalendarShare size={16} />
        </IconButton>
      </span>
    </HuTooltip>
  );
};

export default SchedulePostButton;
