setup husky prettier eslint
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
'use client';
|
||||
|
||||
import React from "react";
|
||||
import { usePathname } from "next/navigation";
|
||||
import React from 'react';
|
||||
import { usePathname } from 'next/navigation';
|
||||
import {
|
||||
Breadcrumb,
|
||||
BreadcrumbItem,
|
||||
@@ -9,18 +9,18 @@ import {
|
||||
BreadcrumbList,
|
||||
BreadcrumbPage,
|
||||
BreadcrumbSeparator,
|
||||
} from "@/components/ui/breadcrumb";
|
||||
} from '@/components/ui/breadcrumb';
|
||||
|
||||
export function BreadcrumbBasic() {
|
||||
const pathname = usePathname();
|
||||
const segments = pathname.split("/").filter((segment) => segment !== "");
|
||||
const segments = pathname.split('/').filter((segment) => segment !== '');
|
||||
|
||||
// Helper to format segment (e.g., "new-analysis" -> "New Analysis")
|
||||
const formatSegment = (segment: string) => {
|
||||
return segment
|
||||
.split("-")
|
||||
.split('-')
|
||||
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
|
||||
.join(" ");
|
||||
.join(' ');
|
||||
};
|
||||
|
||||
return (
|
||||
@@ -32,12 +32,12 @@ export function BreadcrumbBasic() {
|
||||
{segments.length > 0 && <BreadcrumbSeparator />}
|
||||
|
||||
{segments.map((segment, index) => {
|
||||
const href = `/${segments.slice(0, index + 1).join("/")}`;
|
||||
const href = `/${segments.slice(0, index + 1).join('/')}`;
|
||||
const isLast = index === segments.length - 1;
|
||||
|
||||
// Skip segments that represent module groups or generic IDs if needed
|
||||
// For now, mapping all segments
|
||||
|
||||
|
||||
return (
|
||||
<React.Fragment key={href}>
|
||||
<BreadcrumbItem>
|
||||
|
||||
Reference in New Issue
Block a user