mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-09-07 20:05:41 +00:00
chore: fmt
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { ReactNode } from 'react';
|
||||
import Sidebar, { SidebarItem } from './Sidebar';
|
||||
import { ReactNode } from "react";
|
||||
import Sidebar, { SidebarItem } from "./Sidebar";
|
||||
|
||||
export interface DashboardLayoutProps {
|
||||
title?: string;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { ReactNode } from 'react';
|
||||
import clsx from 'clsx';
|
||||
import { ReactNode } from "react";
|
||||
import clsx from "clsx";
|
||||
|
||||
export interface SidebarItem {
|
||||
label: string;
|
||||
@@ -16,7 +16,11 @@ export interface SidebarProps {
|
||||
|
||||
const Sidebar = ({ title, items, activeHref, onNavigate }: SidebarProps) => (
|
||||
<aside className="flex w-60 flex-col gap-1 border-r border-gray-200 bg-white px-3 py-4">
|
||||
{title ? <div className="px-2 pb-3 text-sm font-semibold text-gray-700">{title}</div> : null}
|
||||
{title ? (
|
||||
<div className="px-2 pb-3 text-sm font-semibold text-gray-700">
|
||||
{title}
|
||||
</div>
|
||||
) : null}
|
||||
<nav className="flex flex-col gap-0.5">
|
||||
{items.map((item) => (
|
||||
<a
|
||||
@@ -29,13 +33,15 @@ const Sidebar = ({ title, items, activeHref, onNavigate }: SidebarProps) => (
|
||||
}
|
||||
}}
|
||||
className={clsx(
|
||||
'flex items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors',
|
||||
"flex items-center gap-2 rounded-md px-2 py-2 text-sm transition-colors",
|
||||
activeHref === item.href
|
||||
? 'bg-blue-50 text-blue-700'
|
||||
: 'text-gray-700 hover:bg-gray-100',
|
||||
? "bg-blue-50 text-blue-700"
|
||||
: "text-gray-700 hover:bg-gray-100",
|
||||
)}
|
||||
>
|
||||
{item.icon ? <span className="text-gray-500">{item.icon}</span> : null}
|
||||
{item.icon ? (
|
||||
<span className="text-gray-500">{item.icon}</span>
|
||||
) : null}
|
||||
<span>{item.label}</span>
|
||||
</a>
|
||||
))}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
export { default as Sidebar } from './Sidebar';
|
||||
export { default as DashboardLayout } from './DashboardLayout';
|
||||
export type { SidebarProps, SidebarItem } from './Sidebar';
|
||||
export type { DashboardLayoutProps } from './DashboardLayout';
|
||||
export { default as Sidebar } from "./Sidebar";
|
||||
export { default as DashboardLayout } from "./DashboardLayout";
|
||||
export type { SidebarProps, SidebarItem } from "./Sidebar";
|
||||
export type { DashboardLayoutProps } from "./DashboardLayout";
|
||||
|
||||
Reference in New Issue
Block a user