/ linuxy / src / components / Sidebar.tsx
Swadhin Biswas fix: resolve all ESLint and prettier issues · 3/30/2026
6203776
88 lines · 2.3 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
import { LayoutGrid, Settings, RefreshCw, Compass } from "lucide-react";
import React from "react";

interface SidebarProps {
  currentView: "library" | "settings" | "discover";
  onViewChange: (v: "library" | "settings" | "discover") => void;
  onRefresh: () => void;
}

const Sidebar: React.FC<SidebarProps> = ({ currentView, onViewChange, onRefresh }) => {
  return (
    <div
      style={{
        width: "250px",
        background: "var(--bg-sidebar)",
        display: "flex",
        flexDirection: "column",
        padding: "20px 0",
        borderRight: "1px solid var(--border-color)",
        transition: "background-color 0.3s, border-color 0.3s",
      }}
    >
      <div
        style={{
          padding: "0 20px",
          marginBottom: "30px",
          fontSize: "24px",
          fontWeight: "bold",
          color: "var(--text-primary)",
        }}
      >
        linuxy
      </div>

      <button
        style={{
          ...btnStyle,
          background: currentView === "library" ? "rgba(255, 255, 255, 0.1)" : "transparent",
        }}
        onClick={() => onViewChange("library")}
      >
        <LayoutGrid size={18} style={{ marginRight: 10 }} /> Library
      </button>

      <button
        style={{
          ...btnStyle,
          background: currentView === "discover" ? "rgba(255, 255, 255, 0.1)" : "transparent",
        }}
        onClick={() => onViewChange("discover")}
      >
        <Compass size={18} style={{ marginRight: 10 }} /> Discover
      </button>

      <button
        style={{
          ...btnStyle,
          background: currentView === "settings" ? "rgba(255, 255, 255, 0.1)" : "transparent",
        }}
        onClick={() => onViewChange("settings")}
      >
        <Settings size={18} style={{ marginRight: 10 }} /> Settings
      </button>

      <div style={{ flex: 1 }} />

      <button style={{ ...btnStyle, background: "transparent" }} onClick={onRefresh}>
        <RefreshCw size={18} style={{ marginRight: 10 }} /> Refresh
      </button>
    </div>
  );
};

const btnStyle: React.CSSProperties = {
  display: "flex",
  alignItems: "center",
  padding: "10px 20px",
  border: "none",
  color: "var(--text-primary)",
  cursor: "pointer",
  textAlign: "left",
  fontSize: "16px",
  width: "100%",
  transition: "background 0.2s",
};

export default Sidebar;