cardsConfig.js 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. export function buildOverviewCards({
  2. explorerHref,
  3. searchHref,
  4. canManageUsers,
  5. disabledHint,
  6. }) {
  7. const cards = [
  8. {
  9. key: "explorer",
  10. title: "Explorer",
  11. description: "Lieferscheine nach Datum durchsuchen (Jahr -> Monat -> Tag).",
  12. imageSrc: "/overview-cards/v2/explorer.webp",
  13. href: explorerHref || null,
  14. disabledHint: disabledHint || null,
  15. },
  16. {
  17. key: "search",
  18. title: "Suche",
  19. description: "Schnell finden mit Volltext, Zeitraum und Filtern.",
  20. imageSrc: "/overview-cards/v2/search.webp",
  21. href: searchHref || null,
  22. disabledHint: disabledHint || null,
  23. },
  24. {
  25. key: "profile",
  26. title: "Profil",
  27. description: "Passwort ändern und Support kontaktieren.",
  28. imageSrc: "/overview-cards/v2/profile.webp",
  29. href: "/profile",
  30. disabledHint: null,
  31. },
  32. ];
  33. if (canManageUsers) {
  34. cards.push({
  35. key: "users",
  36. title: "Benutzerverwaltung",
  37. description: "Benutzer anlegen, bearbeiten und verwalten.",
  38. imageSrc: "/overview-cards/v2/users.webp",
  39. href: "/admin/users",
  40. disabledHint: null,
  41. });
  42. }
  43. return cards;
  44. }