Spaces:
Configuration error

File size: 935 Bytes
2d63f96
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
import { cn } from "#/utils/utils";
import { ExplorerActions } from "./file-explorer-actions";

interface FileExplorerHeaderProps {
  isOpen: boolean;
  onToggle: () => void;
  onRefreshWorkspace: () => void;
}

export function FileExplorerHeader({
  isOpen,
  onToggle,
  onRefreshWorkspace,
}: FileExplorerHeaderProps) {
  const { t } = useTranslation();

  return (
    <div
      className={cn(
        "sticky top-0 bg-base-secondary",
        "flex items-center",
        !isOpen ? "justify-center" : "justify-between",
      )}
    >
      {isOpen && (
        <div className="text-neutral-300 font-bold text-sm">
          {t(I18nKey.EXPLORER$LABEL_WORKSPACE)}
        </div>
      )}
      <ExplorerActions
        isHidden={!isOpen}
        toggleHidden={onToggle}
        onRefresh={onRefreshWorkspace}
      />
    </div>
  );
}