File size: 2,429 Bytes
275fd75
 
 
 
f8d0efc
1ec5094
275fd75
 
 
f8d0efc
275fd75
b1850b7
 
275fd75
 
9dfab18
275fd75
 
 
9dfab18
 
1ec5094
 
b1850b7
275fd75
 
 
 
 
 
 
 
 
 
9dfab18
1ec5094
275fd75
 
 
9dfab18
275fd75
9dfab18
1ec5094
 
 
275fd75
b1850b7
9dfab18
 
b1850b7
 
 
9dfab18
275fd75
 
 
 
 
 
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
// src/components/logo/Logo.tsx

import React from 'react';
import cn from "classnames";
import { humanAiIcon } from '../icons';
import './Logo.scss'; // <<--- این ایمپورت بسیار مهم است و باید وجود داشته باشد

type LogoProps = {
  isMini: boolean;
  isAi: boolean;
  isActive: boolean;
  speakingVolume?: number;
  isUserSpeaking?: boolean;
}

export default function Logo({isAi, isActive, isMini, speakingVolume = 0, isUserSpeaking = false}: LogoProps) {

  if (!isActive) return null;

  const aiVoiceScale = 1 + (speakingVolume * 1.5);

  const humanColor = isUserSpeaking ? "#FFFFFF" : "#E2E8F0"; 
  const aiColor = "#FFFFFF";

  return (
    <div className={cn("w-fit flex items-center justify-center")}>
      <div className={"hidden bg-green-200 bg-green-300 bg-green-400 bg-blue-200 bg-blue-300 bg-blue-400 dark:bg-green-700 dark:bg-green-600 dark:bg-green-500 dark:bg-blue-700 dark:bg-blue-600 dark:bg-blue-500"}>
        color pre-loader
      </div>

      <div className={cn("relative", isMini ? "w-[80px] h-[80px]" : "w-[200px] h-[200px]")}>
          <>
            <div
              className={cn(
                "absolute rounded-full opacity-50",
                "ai-speaking-ripple",
                isAi ? "bg-green-200 dark:bg-green-700" : "bg-blue-200 dark:bg-blue-700",
                isMini ? "inset-[10px]" : "inset-[40px]",
              )}
              style={{ '--ai-voice-scale': aiVoiceScale } as React.CSSProperties}
            />
            
            <div className={cn("absolute inset-0 rounded-full opacity-50", isAi ? "bg-green-200 dark:bg-green-700" : "bg-blue-200 dark:bg-blue-700")} />
            <div className={cn("absolute rounded-full opacity-50", isAi ? "bg-green-300 dark:bg-green-600" : "bg-blue-300 dark:bg-blue-600", isMini ? "inset-[5px]" : "inset-[20px]")} />
            <div className={cn("absolute rounded-full opacity-50", isAi ? "bg-green-400 dark:bg-green-500" : "bg-blue-400 dark:bg-blue-500", isMini ? "inset-[12px]" : "inset-[50px]")} />

            <div className={cn("z-10 absolute flex items-center justify-center inset-0")}>
              {humanAiIcon({ 
                size: isMini ? 24 : 45,
                className: cn({ 'user-speaking': isUserSpeaking }),
                humanColor: humanColor,
                aiColor: aiColor,
              })}
            </div>
          </>
      </div>
    </div>
  );
}