46 lines
1 KiB
TypeScript
46 lines
1 KiB
TypeScript
// * Packages
|
|
import { clsx, type ClassValue } from "clsx";
|
|
import { Copy, Eye, Pencil, Plus, Trash2 } from "lucide-react";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
/**
|
|
* Merge classes.
|
|
* @param inputs ClassValue[]
|
|
* @returns string
|
|
*/
|
|
export function cn(...inputs: ClassValue[]): string {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
/**
|
|
* List all actions on back-end models.
|
|
* @return object
|
|
*/
|
|
export const Views = {
|
|
ALL: { label: "tous", value: "all", policy: "viewAny", icon: Plus },
|
|
CREATION: {
|
|
label: "creation",
|
|
value: "create",
|
|
policy: "create",
|
|
icon: Plus,
|
|
},
|
|
DUPLICATION: {
|
|
label: "duplication",
|
|
value: "duplicate",
|
|
policy: "duplicate",
|
|
icon: Copy,
|
|
},
|
|
DELETION: {
|
|
label: "suppression",
|
|
value: "destroy",
|
|
policy: "delete",
|
|
icon: Trash2,
|
|
},
|
|
EDITION: {
|
|
label: "edition",
|
|
value: "edit",
|
|
policy: "update",
|
|
icon: Pencil,
|
|
},
|
|
SHOW: { label: "details", value: "show", policy: "view", icon: Eye },
|
|
};
|