All files / src/components/Sidebar VersionInfo.tsx

0% Statements 0/8
0% Branches 0/7
0% Functions 0/1
0% Lines 0/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36                                                                       
import useSidebar from "../../hooks/common/sidebar/useSidebar";
import { useFetchVersionInfoQuery } from "../../store/features/management/api";
 
function VersionInfo() {
  const { data } = useFetchVersionInfoQuery();
  const { isOpen } = useSidebar();
 
  Iif (!data) return;
 
  return (
    <div
      className={`mb-2 text-xs text-gray-600 flex ${
        isOpen ? "flex-row" : "flex-col"
      } gap-2 px-1 mt-1 justify-center items-center max-w-full text-ellipsis`}>
      {data.current_version && (
        <p className="line-clamp-1">{data?.current_version}</p>
      )}
      {data.should_upgrade && (
        <>
          <p className="bg-violet-50 p-1 rounded overflow-hidden max-w-full">
            <a
              href="https://github.com/DrDroidLab/PlayBooks/releases"
              target="_blank"
              rel="noreferrer"
              className="line-clamp-3">
              {data.upgrade_message}
            </a>
          </p>
        </>
      )}
    </div>
  );
}
 
export default VersionInfo;