import { bytesFrom } from 'src/utils/bytes';

export const POLL_MIN_OPTIONS = 2;
export const POLL_MAX_OPTIONS = 4;

export const POSTS_LIMIT_PER_PAGE = 10;

export const MAX_ATTACHMENTS_MB = 100;
export const MAX_ATTACHMENTS_B = bytesFrom(MAX_ATTACHMENTS_MB, 'MB');
export const MAX_POST_BODY_TEXT_LENGTH = 10_000;
export const MAX_POST_BODY_HTML_LENGTH = 40_000;

export const LARGE_POST_WARNING_THRESHOLD_MB = 200;
export const LARGE_POST_WARNING_THRESHOLD_B = bytesFrom(
  LARGE_POST_WARNING_THRESHOLD_MB,
  'MB',
);

export const VISIBLE_PERCENT_FOR_POST_METRIC = 0.5;
export const VIEW_TIME_FOR_POST_METRIC = 3000;
export const DOMAIN_NAME_REGEX = /^https?:\/\/(?:www\.)?([^\/]+)(?:\/.*)?$/;

export const MAX_NAME_LENGTH = 40;
export const MAX_GROUP_NAME_LENGTH = 30;
