"use client"; import { usePathname } from "next/navigation"; import React from "react"; import { Progress } from "@/components/shadcn/progress"; import { VerticalSteps } from "./vertical-steps"; const steps = [ { title: "Create a new role", description: "Enter the name of the role you want to add.", href: "/roles/new", }, { title: "Edit a existing role", description: "Update the role's details, including its name and permissions.", href: "/roles/edit", }, ]; export const WorkflowAddEditRole = () => { const pathname = usePathname(); // Calculate current step based on pathname const currentStepIndex = steps.findIndex((step) => pathname.endsWith(step.href), ); const currentStep = currentStepIndex === -1 ? 0 : currentStepIndex; return (

Manage Role Permissions

Define a new role with customized permissions or modify an existing one to meet your needs.

Steps {`${currentStep + 1} of ${steps.length}`}
); };