import { dataEncryption } from '@/config/encryption';
import { WOSA_ADMIN_URL } from '@/config/site-config';

const CaseInfoLink = ({ visa_case_id }: { visa_case_id: string | number }) => {
  const handleClick = () => {
    // If you need to handle navigation programmatically
    const encryptedId = dataEncryption(String(visa_case_id));
    const url = `${WOSA_ADMIN_URL}visa_case_info/index/${encryptedId}/visa_pre_enrolled_cases/assign_to_all_`;
    window.open(url, '_blank');
  };

  return (
    <a
      href={`${WOSA_ADMIN_URL}visa_case_info/index/${dataEncryption(String(visa_case_id))}/visa_pre_enrolled_cases/assign_to_all_`}
      className="btn btn-danger btn-xs"
      data-toggle="tooltip"
      title="Case Information"
      target="_blank"
      rel="noopener noreferrer"
    >
      <span className="fa fa-inbox"></span>
    </a>
  );
};

export default CaseInfoLink;
