Skip to content

armgit / crm

Public Imported from GitHub
0

Comp AI CRM is an open source, CRM designed for AI agents. Agentic-first CRM.

TypeScript
433 B
Raw Blame
"use client";

import { useParams } from "next/navigation";
import { useCallback } from "react";
import { workspaceUrl } from "@/lib/workspace-url";

export function useWorkspaceSlug(): string {
	const { slug } = useParams<{ slug: string }>();

	return slug;
}

export function useWorkspaceUrl(): (path?: string) => string {
	const slug = useWorkspaceSlug();

	return useCallback((path = "/") => workspaceUrl(slug, path), [slug]);
}