Fix: Resolve import error in Sidebar.tsx

The commit fixes an import error in `Sidebar.tsx` related to the `@/config/site` module. The error message indicates that the module cannot be resolved. The fix likely involves ensuring the correct path to the module or creating the missing file.
This commit is contained in:
gpt-engineer-app[bot] 2025-05-19 18:30:40 +00:00
parent 119a8af96a
commit b06373115b
4 changed files with 29 additions and 8 deletions

View File

@ -1,6 +1,6 @@
import React, { useState, useEffect } from 'react';
import Sidebar from '@/components/layout/Sidebar';
import { Sidebar, defaultItems } from '@/components/layout/Sidebar';
import Header from '@/components/layout/Header';
import { useToast } from "@/components/ui/use-toast";
import { Menu } from 'lucide-react';
@ -39,11 +39,11 @@ const Layout: React.FC<LayoutProps> = ({ children }) => {
</Button>
</SheetTrigger>
<SheetContent side="left" className="p-0 w-[250px]">
<Sidebar className="w-full border-none" />
<Sidebar items={defaultItems} className="w-full border-none" />
</SheetContent>
</Sheet>
) : (
<Sidebar />
<Sidebar items={defaultItems} />
)}
<div className="flex flex-col flex-1 overflow-hidden">
<Header />

View File

@ -1,3 +1,4 @@
import React from "react";
import {
LayoutDashboard,
@ -11,12 +12,13 @@ import { MainNavItem } from "@/types";
import { siteConfig } from "@/config/site";
interface SidebarProps {
items?: MainNavItem[]
items?: MainNavItem[];
className?: string;
}
export function Sidebar({ items }: SidebarProps) {
export function Sidebar({ items, className = "" }: SidebarProps) {
return (
<div className="flex flex-col space-y-6 w-full">
<div className={`flex flex-col space-y-6 w-full ${className}`}>
<a href="/" className="flex items-center space-x-2">
<img
src="/logo.png"
@ -40,7 +42,7 @@ export function Sidebar({ items }: SidebarProps) {
))}
</div>
</div>
)
);
}
export const defaultItems: MainNavItem[] = [
@ -69,4 +71,4 @@ export const defaultItems: MainNavItem[] = [
href: "/rodrigo-audio",
icon: <Headphones className="h-5 w-5" />
},
]
];

9
src/config/site.ts Normal file
View File

@ -0,0 +1,9 @@
export const siteConfig = {
name: "WhatsApp Dashboard",
description: "Gerenciamento de instâncias de WhatsApp",
mainNav: [],
links: {
github: "https://github.com/",
},
};

10
src/types/index.ts Normal file
View File

@ -0,0 +1,10 @@
import { ReactNode } from "react";
export interface MainNavItem {
title: string;
href?: string;
icon?: ReactNode;
disabled?: boolean;
external?: boolean;
}