mirror of
https://github.com/coollabsio/coolify-examples.git
synced 2026-05-12 13:27:41 +00:00
laravel pure
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
import { InertiaLinkProps } from '@inertiajs/vue3';
|
||||
import { clsx, type ClassValue } from 'clsx';
|
||||
import { twMerge } from 'tailwind-merge';
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs));
|
||||
}
|
||||
|
||||
export function urlIsActive(
|
||||
urlToCheck: NonNullable<InertiaLinkProps['href']>,
|
||||
currentUrl: string,
|
||||
) {
|
||||
return toUrl(urlToCheck) === currentUrl;
|
||||
}
|
||||
|
||||
export function toUrl(href: NonNullable<InertiaLinkProps['href']>) {
|
||||
return typeof href === 'string' ? href : href?.url;
|
||||
}
|
||||
Reference in New Issue
Block a user