260320:1131 Refactor Overrall #01
Build and Deploy / deploy (push) Has been cancelled

This commit is contained in:
admin
2026-03-20 11:31:27 +07:00
parent f1b81a7d0d
commit 1d3479770b
147 changed files with 1745 additions and 1567 deletions
+6 -6
View File
@@ -112,14 +112,14 @@ export function Sidebar({ className }: SidebarProps) {
<div className="flex-1 overflow-y-auto py-4">
<nav className="grid gap-1 px-2">
{mainNavItems.map((item, index) => {
{mainNavItems.map((item) => {
if (item.adminOnly && !isAdmin) return null;
const isActive = pathname.startsWith(item.href);
const LinkComponent = (
<Link
key={index}
key={item.href}
href={item.href}
className={cn(
'flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground',
@@ -135,7 +135,7 @@ export function Sidebar({ className }: SidebarProps) {
if (item.permission) {
return (
<Can key={index} permission={item.permission}>
<Can key={item.href} permission={item.permission}>
{LinkComponent}
</Can>
);
@@ -186,14 +186,14 @@ export function MobileSidebar() {
</div>
<div className="flex-1 overflow-y-auto py-4 h-[calc(100vh-4rem)]">
<nav className="grid gap-1 px-2">
{mainNavItems.map((item, index) => {
{mainNavItems.map((item) => {
if (item.adminOnly && !isAdmin) return null;
const isActive = pathname.startsWith(item.href);
const LinkComponent = (
<Link
key={index}
key={item.href}
href={item.href}
onClick={() => setOpen(false)}
className={cn(
@@ -208,7 +208,7 @@ export function MobileSidebar() {
if (item.permission) {
return (
<Can key={index} permission={item.permission}>
<Can key={item.href} permission={item.permission}>
{LinkComponent}
</Can>
);