refactor: remove unused imports and simplify DashboardPage component
This commit is contained in:
@@ -1,12 +1,10 @@
|
|||||||
"use client"
|
"use client"
|
||||||
|
|
||||||
import type { ReactNode } from "react"
|
import type { ReactNode } from "react"
|
||||||
import { usePathname } from "next/navigation"
|
|
||||||
|
|
||||||
import { cn } from "@/lib/utils"
|
import { cn } from "@/lib/utils"
|
||||||
import { TableCell, TableRow } from "@/components/ui/table"
|
import { TableCell, TableRow } from "@/components/ui/table"
|
||||||
import { useI18n } from "@/i18n/provider"
|
import { useI18n } from "@/i18n/provider"
|
||||||
import { getPageTitleKey } from "@/lib/navigation"
|
|
||||||
|
|
||||||
export function DashboardPage({
|
export function DashboardPage({
|
||||||
className,
|
className,
|
||||||
@@ -15,15 +13,8 @@ export function DashboardPage({
|
|||||||
className?: string
|
className?: string
|
||||||
children: ReactNode
|
children: ReactNode
|
||||||
}) {
|
}) {
|
||||||
const t = useI18n()
|
|
||||||
const pathname = usePathname()
|
|
||||||
const title = t(getPageTitleKey(pathname))
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cn("flex flex-1 flex-col gap-4 p-4 lg:p-5", className)}>
|
<div className={cn("flex flex-1 flex-col gap-4 p-4 lg:p-5", className)}>
|
||||||
<div className="flex min-h-8 items-center">
|
|
||||||
<h1 className="text-xl font-semibold tracking-tight">{title}</h1>
|
|
||||||
</div>
|
|
||||||
{children}
|
{children}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user