mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-02-22 08:42:00 +00:00
Update package.json for turbopack support, enhance AppSidebar with new icons, and add Textarea and auth-utils components
- Modified the dev script in package.json to use turbopack for improved development performance. - Enhanced AppSidebar by adding new icons for navigation items, improving visual clarity. - Introduced a new Textarea component for consistent styling and functionality across forms. - Added auth-utils module to fetch the current user session, streamlining user authentication processes.
This commit is contained in:
parent
2cbf9fb773
commit
2b0bd515e7
@ -1,4 +1,12 @@
|
|||||||
import { ChevronRight } from "lucide-react";
|
import {
|
||||||
|
ChevronRight,
|
||||||
|
Coins,
|
||||||
|
CreditCard,
|
||||||
|
Handshake,
|
||||||
|
MonitorSpeaker,
|
||||||
|
Smartphone,
|
||||||
|
UsersRound,
|
||||||
|
} from "lucide-react";
|
||||||
|
|
||||||
import {
|
import {
|
||||||
Collapsible,
|
Collapsible,
|
||||||
@ -29,18 +37,18 @@ const data = {
|
|||||||
{
|
{
|
||||||
title: "Devices",
|
title: "Devices",
|
||||||
url: "/devices",
|
url: "/devices",
|
||||||
|
icon: <Smartphone size={16} />,
|
||||||
},
|
},
|
||||||
{
|
|
||||||
title: "Parental Controls",
|
|
||||||
url: "/parental-controls",
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
title: "Payments",
|
title: "Payments",
|
||||||
url: "/payments",
|
url: "/payments",
|
||||||
|
icon: <CreditCard size={16} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "Agreements",
|
title: "Agreements",
|
||||||
url: "/agreements",
|
url: "/agreements",
|
||||||
|
icon: <Handshake size={16} />,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -52,14 +60,17 @@ const data = {
|
|||||||
{
|
{
|
||||||
title: "Users",
|
title: "Users",
|
||||||
url: "/users",
|
url: "/users",
|
||||||
|
icon: <UsersRound size={16} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "User Devices",
|
title: "User Devices",
|
||||||
url: "/user-devices",
|
url: "/user-devices",
|
||||||
|
icon: <MonitorSpeaker size={16} />,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: "User Payments",
|
title: "User Payments",
|
||||||
url: "/user-payments",
|
url: "/user-payments",
|
||||||
|
icon: <Coins size={16} />,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
@ -78,43 +89,6 @@ export function AppSidebar({
|
|||||||
</h4>
|
</h4>
|
||||||
</SidebarHeader>
|
</SidebarHeader>
|
||||||
<SidebarContent className="gap-0">
|
<SidebarContent className="gap-0">
|
||||||
{/* We create a collapsible SidebarGroup for each parent. */}
|
|
||||||
{/* {data.navMain.map((item) => (
|
|
||||||
|
|
||||||
<Collapsible
|
|
||||||
key={item.title}
|
|
||||||
title={item.title}
|
|
||||||
defaultOpen
|
|
||||||
className="group/collapsible"
|
|
||||||
>
|
|
||||||
<SidebarGroup>
|
|
||||||
<SidebarGroupLabel
|
|
||||||
asChild
|
|
||||||
className="group/label text-sm text-sidebar-foreground hover:bg-sidebar-accent hover:text-sidebar-accent-foreground"
|
|
||||||
>
|
|
||||||
<CollapsibleTrigger>
|
|
||||||
{item.title}{" "}
|
|
||||||
<ChevronRight className="ml-auto transition-transform group-data-[state=open]/collapsible:rotate-90" />
|
|
||||||
</CollapsibleTrigger>
|
|
||||||
</SidebarGroupLabel>
|
|
||||||
<CollapsibleContent>
|
|
||||||
<SidebarGroupContent>
|
|
||||||
<SidebarMenu>
|
|
||||||
{item.items.map((item) => (
|
|
||||||
<SidebarMenuItem key={item.title}>
|
|
||||||
<SidebarMenuButton className="py-6" asChild>
|
|
||||||
<Link className="text-md" href={item.url}>
|
|
||||||
{item.title}
|
|
||||||
</Link>
|
|
||||||
</SidebarMenuButton>
|
|
||||||
</SidebarMenuItem>
|
|
||||||
))}
|
|
||||||
</SidebarMenu>
|
|
||||||
</SidebarGroupContent>
|
|
||||||
</CollapsibleContent>
|
|
||||||
</SidebarGroup>
|
|
||||||
</Collapsible>
|
|
||||||
))} */}
|
|
||||||
{data.navMain
|
{data.navMain
|
||||||
.filter(
|
.filter(
|
||||||
(item) =>
|
(item) =>
|
||||||
@ -146,7 +120,10 @@ export function AppSidebar({
|
|||||||
<SidebarMenuItem key={item.title}>
|
<SidebarMenuItem key={item.title}>
|
||||||
<SidebarMenuButton className="py-6" asChild>
|
<SidebarMenuButton className="py-6" asChild>
|
||||||
<Link className="text-md" href={item.url}>
|
<Link className="text-md" href={item.url}>
|
||||||
{item.title}
|
{item.icon}
|
||||||
|
<span className="opacity-70 ml-2">
|
||||||
|
{item.title}
|
||||||
|
</span>
|
||||||
</Link>
|
</Link>
|
||||||
</SidebarMenuButton>
|
</SidebarMenuButton>
|
||||||
</SidebarMenuItem>
|
</SidebarMenuItem>
|
||||||
|
22
components/ui/textarea.tsx
Normal file
22
components/ui/textarea.tsx
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import * as React from "react"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
const Textarea = React.forwardRef<
|
||||||
|
HTMLTextAreaElement,
|
||||||
|
React.ComponentProps<"textarea">
|
||||||
|
>(({ className, ...props }, ref) => {
|
||||||
|
return (
|
||||||
|
<textarea
|
||||||
|
className={cn(
|
||||||
|
"flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-sm placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
ref={ref}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
})
|
||||||
|
Textarea.displayName = "Textarea"
|
||||||
|
|
||||||
|
export { Textarea }
|
10
lib/auth-utils.ts
Normal file
10
lib/auth-utils.ts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
"use server";
|
||||||
|
import { headers } from "next/headers";
|
||||||
|
import { auth } from "./auth";
|
||||||
|
|
||||||
|
export async function getCurrentUser() {
|
||||||
|
const session = await auth.api.getSession({
|
||||||
|
headers: await headers(),
|
||||||
|
});
|
||||||
|
return session?.user;
|
||||||
|
}
|
@ -3,7 +3,7 @@
|
|||||||
"version": "0.1.0",
|
"version": "0.1.0",
|
||||||
"private": true,
|
"private": true,
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "next dev",
|
"dev": "next dev --turbopack",
|
||||||
"build": "next build",
|
"build": "next build",
|
||||||
"start": "next start",
|
"start": "next start",
|
||||||
"lint": "next lint"
|
"lint": "next lint"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user