feat: add matrix section

This commit is contained in:
2026-08-12 18:45:57 +02:00
parent eb751f9404
commit 00adc4df53
16 changed files with 657 additions and 1986 deletions
+8 -8
View File
@@ -2,8 +2,8 @@ import { useEffect, useRef, useState } from 'react';
import './Sidebar.css';
import { ChevronLeftIcon } from '../../assets/icons/ChevronLeftIcon';
export type SidebarItem = {
id: string;
export type SidebarItem<T extends string = string> = {
id: T;
label: string;
icon: React.ReactNode;
};
@@ -13,12 +13,12 @@ export type SidebarAppOption = {
name: string;
};
function SidebarButton({
function SidebarButton<T extends string>({
item,
active,
onSelect,
}: {
item: SidebarItem;
item: SidebarItem<T>;
active: boolean;
onSelect: () => void;
}) {
@@ -218,7 +218,7 @@ function AppCombobox({
);
}
export default function Sidebar({
export function Sidebar<T extends string>({
items,
activeId,
onSelect,
@@ -230,9 +230,9 @@ export default function Sidebar({
expanded,
onToggle,
}: {
items: SidebarItem[];
activeId: string | null;
onSelect: (id: string) => void;
items: SidebarItem<T>[];
activeId: T | null;
onSelect: (id: T) => void;
appName: string;
appOptions?: SidebarAppOption[];
selectedAppId?: string;