File size: 1,550 Bytes
5eefa6a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import { BrainCircuit, BarChart2 } from "lucide-react";

export type Phase = "interview" | "analytics";

interface PhaseToggleProps {
  phase: Phase;
  onChange: (phase: Phase) => void;
  disabled?: boolean;
}

export default function PhaseToggle({ phase, onChange, disabled }: PhaseToggleProps) {
  return (
    <div
      className="flex items-center bg-slate-100 rounded-full p-0.5 text-xs select-none"
      title={disabled ? "Interview sedang berlangsung" : undefined}
    >
      <button
        onClick={() => !disabled && onChange("interview")}
        className={`flex items-center gap-1.5 px-3 py-1.5 rounded-full transition-all duration-200 ${
          phase === "interview"
            ? "bg-white text-emerald-700 shadow-sm font-medium"
            : "text-slate-500 hover:text-slate-700"
        } ${disabled && phase !== "interview" ? "opacity-40 cursor-not-allowed" : "cursor-pointer"}`}
      >
        <BrainCircuit className="w-3.5 h-3.5" />
        <span>Interview</span>
      </button>
      <button
        onClick={() => !disabled && onChange("analytics")}
        className={`flex items-center gap-1.5 px-3 py-1.5 rounded-full transition-all duration-200 ${
          phase === "analytics"
            ? "bg-white text-blue-700 shadow-sm font-medium"
            : "text-slate-500 hover:text-slate-700"
        } ${disabled && phase !== "analytics" ? "opacity-40 cursor-not-allowed" : "cursor-pointer"}`}
      >
        <BarChart2 className="w-3.5 h-3.5" />
        <span>Analytics</span>
      </button>
    </div>
  );
}