import { Button, Tooltip } from "antd";
import { useTranslation } from "react-i18next";

export default function ChatMarkUnreadButton({ disabled, loading, onMarkUnread }) {
  const { t } = useTranslation();

  return (
    <Tooltip title={t("messaging.labels.mark_unread")}>
      <Button
        size="small"
        className="unread-button"
        type="primary"
        children={t("messaging.labels.mark_unread")}
        loading={loading}
        disabled={disabled}
        onMouseDown={(e) => e.stopPropagation()} // prevent parent mark-read handler
        onClick={(e) => {
          e.stopPropagation();
          onMarkUnread?.();
        }}
      />
    </Tooltip>
  );
}
