File size: 1,202 Bytes
09801ca
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
37
38
39
40
41
42
43
import React from 'react';
import { useUserStore } from '../store/userStore';

interface LogoImageProps {
  className?: string;
  size?: number;
  showText?: boolean;
  isDark?: boolean;
}

const LogoImage: React.FC<LogoImageProps> = ({ 
  className = '', 
  size = 36, 
  showText = true, 
  isDark: forceDark 
}) => {
  const { isDark: storeIsDark } = useUserStore();
  const isDark = forceDark !== undefined ? forceDark : storeIsDark;

  // Theme-aware logo assets: dark mode logo asset on dark mode, light mode logo asset on light mode
  const logoSrc = isDark ? '/datavision-logo-dark.png' : '/datavision-logo-light.png';

  return (
    <div className={`flex items-center gap-2.5 select-none font-sans ${className}`}>
      <img
        src={logoSrc}
        alt="DataVision Logo"
        width={size}
        height={size}
        className="object-contain rounded-lg shrink-0 shadow-xs transition-opacity duration-300"
        style={{ width: size, height: size }}
      />
      {showText && (
        <span className={`font-black tracking-tight text-xl ${isDark ? 'text-white' : 'text-[#111827]'}`}>
          DataVision
        </span>
      )}
    </div>
  );
};

export default LogoImage;