mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-08-23 02:27:14 +00:00
45 lines
905 B
TypeScript
45 lines
905 B
TypeScript
import styles from './HomeSidebar.module.css';
|
|
|
|
export interface ISidebarChildVO {
|
|
id: string;
|
|
icon: React.ReactNode;
|
|
name: string;
|
|
route: string;
|
|
}
|
|
|
|
export class SidebarChildVO {
|
|
id: string;
|
|
icon: React.ReactNode;
|
|
name: string;
|
|
route: string;
|
|
|
|
constructor(props: ISidebarChildVO) {
|
|
this.id = props.id;
|
|
this.icon = props.icon;
|
|
this.name = props.name;
|
|
this.route = props.route;
|
|
}
|
|
}
|
|
|
|
export function SidebarChild({
|
|
icon,
|
|
name,
|
|
isSelected,
|
|
onClick,
|
|
}: {
|
|
icon: React.ReactNode;
|
|
name: string;
|
|
isSelected: boolean;
|
|
onClick: () => void;
|
|
}) {
|
|
return (
|
|
<div
|
|
className={`${styles.sidebarChildContainer} ${isSelected ? styles.sidebarSelected : styles.sidebarUnselected}`}
|
|
onClick={onClick}
|
|
>
|
|
<div className={`${styles.sidebarChildIcon}`}>{icon}</div>
|
|
<span className={`${styles.sidebarChildName}`}>{name}</span>
|
|
</div>
|
|
);
|
|
}
|