tr]:last:border-b-0",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function TableRow({ className, ...props }: React.ComponentProps<"tr">) {
+ return (
+
+ );
+}
+
+function TableHead({ className, ...props }: React.ComponentProps<"th">) {
+ return (
+ [role=checkbox]]:translate-y-[2px]",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function TableCell({ className, ...props }: React.ComponentProps<"td">) {
+ return (
+ | [role=checkbox]]:translate-y-[2px]",
+ className,
+ )}
+ {...props}
+ />
+ );
+}
+
+function TableCaption({
+ className,
+ ...props
+}: React.ComponentProps<"caption">) {
+ return (
+
+ );
+}
+
+export {
+ Table,
+ TableHeader,
+ TableBody,
+ TableFooter,
+ TableHead,
+ TableRow,
+ TableCell,
+ TableCaption,
+};
diff --git a/src/shared/ui/textarea.tsx b/src/shared/ui/textarea.tsx
new file mode 100644
index 0000000..8808070
--- /dev/null
+++ b/src/shared/ui/textarea.tsx
@@ -0,0 +1,18 @@
+import * as React from "react";
+
+import { cn } from "@/shared/lib/utils";
+
+function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
+ return (
+
+ );
+}
+
+export { Textarea };
diff --git a/src/shared/ui/tooltip.tsx b/src/shared/ui/tooltip.tsx
new file mode 100644
index 0000000..d0e1784
--- /dev/null
+++ b/src/shared/ui/tooltip.tsx
@@ -0,0 +1,59 @@
+import * as React from "react";
+import * as TooltipPrimitive from "@radix-ui/react-tooltip";
+
+import { cn } from "@/shared/lib/utils";
+
+function TooltipProvider({
+ delayDuration = 0,
+ ...props
+}: React.ComponentProps) {
+ return (
+
+ );
+}
+
+function Tooltip({
+ ...props
+}: React.ComponentProps) {
+ return (
+
+
+
+ );
+}
+
+function TooltipTrigger({
+ ...props
+}: React.ComponentProps) {
+ return ;
+}
+
+function TooltipContent({
+ className,
+ sideOffset = 0,
+ children,
+ ...props
+}: React.ComponentProps) {
+ return (
+
+
+ {children}
+
+
+
+ );
+}
+
+export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider };
diff --git a/src/widgets/lang-toggle/ui/lang-toggle.tsx b/src/widgets/lang-toggle/ui/lang-toggle.tsx
index 8a103e5..29ab8f9 100644
--- a/src/widgets/lang-toggle/ui/lang-toggle.tsx
+++ b/src/widgets/lang-toggle/ui/lang-toggle.tsx
@@ -1,14 +1,14 @@
-import { LanguageRoutes } from '@/shared/config/i18n/type';
-import { Button } from '@/shared/ui/button';
+import { LanguageRoutes } from "@/shared/config/i18n/type";
+import { Button } from "@/shared/ui/button";
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuItem,
DropdownMenuTrigger,
-} from '@/shared/ui/dropdown-menu';
-import { languages } from '@/widgets/lang-toggle/lib/data';
-import { GlobeIcon } from 'lucide-react';
-import { useTranslation } from 'react-i18next';
+} from "@/shared/ui/dropdown-menu";
+import { languages } from "@/widgets/lang-toggle/lib/data";
+import { GlobeIcon } from "lucide-react";
+import { useTranslation } from "react-i18next";
const LangToggle = () => {
const { i18n } = useTranslation();
@@ -21,7 +21,7 @@ const LangToggle = () => {
diff --git a/src/widgets/sidebar-layout/index.tsx b/src/widgets/sidebar-layout/index.tsx
new file mode 100644
index 0000000..9d56b42
--- /dev/null
+++ b/src/widgets/sidebar-layout/index.tsx
@@ -0,0 +1,133 @@
+import {
+ CircleQuestionMark,
+ FolderOpen,
+ Image,
+ LayoutDashboard,
+ LogOut,
+ Package,
+ Ruler,
+ ShoppingCart,
+ Users,
+} from "lucide-react";
+import { Link, useLocation, useNavigate } from "react-router-dom";
+
+import { removeToken } from "@/shared/lib/cookie";
+import { Button } from "@/shared/ui/button";
+import {
+ Sidebar,
+ SidebarContent,
+ SidebarFooter,
+ SidebarGroup,
+ SidebarGroupContent,
+ SidebarGroupLabel,
+ SidebarMenu,
+ SidebarMenuButton,
+ SidebarMenuItem,
+} from "@/shared/ui/sidebar";
+
+const items = [
+ {
+ title: "Bosh sahifa",
+ url: "/dashboard",
+ icon: LayoutDashboard,
+ },
+ {
+ title: "Mahsulotlar",
+ url: "/dashboard/products",
+ icon: Package,
+ },
+ {
+ title: "Kategoriyalar",
+ url: "/dashboard/categories",
+ icon: FolderOpen,
+ },
+ {
+ title: "Birliklar",
+ url: "/dashboard/units",
+ icon: Ruler,
+ },
+ {
+ title: "Bannerlar",
+ url: "/dashboard/banners",
+ icon: Image,
+ },
+ {
+ title: "Zakazlar",
+ url: "/dashboard/orders",
+ icon: ShoppingCart,
+ },
+ {
+ title: "Foydalanuvchilar",
+ url: "/dashboard/users",
+ icon: Users,
+ },
+ {
+ title: "Faq",
+ url: "/dashboard/faq",
+ icon: CircleQuestionMark,
+ },
+];
+
+export function AppSidebar() {
+ const location = useLocation();
+ const navigate = useNavigate();
+
+ const isActive = (url: string) => {
+ if (url === "/dashboard") {
+ return location.pathname === "/dashboard";
+ }
+ return location.pathname.startsWith(url);
+ };
+
+ return (
+
+
+
+
+
+ GASTRO
+
+
+
+
+ {items.map((item) => (
+
+
+
+
+ {item.title}
+
+
+
+ ))}
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/src/widgets/welcome/ui/welcome.tsx b/src/widgets/welcome/ui/welcome.tsx
index c417f38..48611e4 100644
--- a/src/widgets/welcome/ui/welcome.tsx
+++ b/src/widgets/welcome/ui/welcome.tsx
@@ -1,17 +1,8 @@
-import { getPosts } from '@/shared/config/api/test/test.request';
-import LangToggle from '@/widgets/lang-toggle/ui/lang-toggle';
-import ModeToggle from '@/widgets/theme-toggle/ui/theme-toggle';
-import { useQuery } from '@tanstack/react-query';
-import GitHubButton from 'react-github-btn';
+import LangToggle from "@/widgets/lang-toggle/ui/lang-toggle";
+import ModeToggle from "@/widgets/theme-toggle/ui/theme-toggle";
+import GitHubButton from "react-github-btn";
const Welcome = () => {
- const { data } = useQuery({
- queryKey: ['posts'],
- queryFn: () => getPosts(),
- });
-
- console.log('data', data);
-
return (
diff --git a/vite.config.ts b/vite.config.ts
index 52e5996..e491418 100644
--- a/vite.config.ts
+++ b/vite.config.ts
@@ -1,7 +1,7 @@
-import { defineConfig } from "vite";
-import react from "@vitejs/plugin-react";
import tailwindcss from "@tailwindcss/vite";
+import react from "@vitejs/plugin-react";
import path from "path";
+import { defineConfig } from "vite";
import tsconfigPaths from "vite-tsconfig-paths";
// https://vite.dev/config/
@@ -10,4 +10,8 @@ export default defineConfig({
resolve: {
alias: [{ find: "@", replacement: path.resolve(__dirname, "src") }],
},
+ server: {
+ port: 3000,
+ open: true,
+ },
});
|