mirror of
https://github.com/Since-3/Kuma.git
synced 2026-10-12 21:41:17 +00:00
Merge pull request #31 from Since-3/bug/delete-dialog-wording
abstracted delete dialog and removed location from sidebar
This commit is contained in:
commit
26ac2d8e8e
5 changed files with 14 additions and 16 deletions
|
|
@ -13,7 +13,8 @@ import {
|
|||
interface DeleteDialogProps {
|
||||
open: boolean;
|
||||
onOpenChange: (open: boolean) => void;
|
||||
courseName?: string;
|
||||
itemName?: string;
|
||||
topicName?: string;
|
||||
onConfirm: () => void;
|
||||
isLoading?: boolean;
|
||||
}
|
||||
|
|
@ -21,7 +22,8 @@ interface DeleteDialogProps {
|
|||
const DeleteDialog: React.FC<DeleteDialogProps> = ({
|
||||
open,
|
||||
onOpenChange,
|
||||
courseName,
|
||||
itemName,
|
||||
topicName,
|
||||
onConfirm,
|
||||
isLoading,
|
||||
}) => {
|
||||
|
|
@ -30,10 +32,10 @@ const DeleteDialog: React.FC<DeleteDialogProps> = ({
|
|||
<DialogContent className="sm:max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle className="flex gap-4 items-center text-xl">
|
||||
<AlertTriangle /> Kurs wirklich löschen?
|
||||
<AlertTriangle /> {topicName} wirklich löschen?
|
||||
</DialogTitle>
|
||||
<DialogDescription className="mt-2 text-gray-600">
|
||||
Der Kurs <span className="font-semibold text-gray-600">{courseName}</span> wird
|
||||
Der {topicName}: <span className="font-semibold text-gray-600">{itemName}</span> wird
|
||||
dauerhaft gelöscht. Diese Aktion kann nicht rückgängig gemacht werden.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
|
|
@ -44,7 +46,7 @@ const DeleteDialog: React.FC<DeleteDialogProps> = ({
|
|||
</Button>
|
||||
</DialogClose>
|
||||
<Button variant="destructive" className="mt-6" onClick={onConfirm} disabled={isLoading}>
|
||||
{isLoading ? "Lösche..." : "Kurs löschen"}
|
||||
{isLoading ? "Lösche..." : `${topicName} löschen`}
|
||||
</Button>
|
||||
</DialogFooter>
|
||||
</DialogContent>
|
||||
|
|
|
|||
|
|
@ -362,7 +362,7 @@ const CourseListView = () => {
|
|||
<Filter size={18} />
|
||||
Filter
|
||||
{activeFiltersCount > 0 && (
|
||||
<span className="absolute -top-2 -right-2 bg-yellow text-white text-xs font-bold rounded-full h-5 w-5 flex items-center justify-center">
|
||||
<span className="absolute -top-2 -right-2 bg-yellow text-blue text-xs font-bold rounded-full h-5 w-5 flex items-center justify-center">
|
||||
{activeFiltersCount}
|
||||
</span>
|
||||
)}
|
||||
|
|
@ -466,7 +466,8 @@ const CourseListView = () => {
|
|||
<DeleteDialog
|
||||
open={deleteDialogOpen}
|
||||
onOpenChange={setDeleteDialogOpen}
|
||||
courseName={courseToDelete?.name}
|
||||
itemName={courseToDelete?.name}
|
||||
topicName="Kurs"
|
||||
onConfirm={confirmDelete}
|
||||
isLoading={isDeleting}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -17,7 +17,6 @@ import {
|
|||
Dumbbell,
|
||||
IdCardLanyard,
|
||||
LayoutDashboard,
|
||||
MapPinned,
|
||||
User,
|
||||
} from "lucide-react";
|
||||
|
||||
|
|
@ -78,12 +77,6 @@ const allMenuItems = [
|
|||
href: "/marketing",
|
||||
roles: ["manager"],
|
||||
},
|
||||
{
|
||||
icon: MapPinned,
|
||||
label: "Standorte",
|
||||
href: "/standorte",
|
||||
roles: ["manager"],
|
||||
},
|
||||
];
|
||||
|
||||
interface DashboardSidebarProps {
|
||||
|
|
|
|||
|
|
@ -141,7 +141,8 @@ const EmployeeListView = () => {
|
|||
<DeleteDialog
|
||||
open={deleteDialogOpen}
|
||||
onOpenChange={setDeleteDialogOpen}
|
||||
courseName={employeeToDelete?.name}
|
||||
itemName={employeeToDelete?.name}
|
||||
topicName="Mitarbeiter"
|
||||
onConfirm={confirmDelete}
|
||||
isLoading={isDeleting}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -112,7 +112,8 @@ const RoomsListView = ({ deleteMode }: RoomsListViewProps) => {
|
|||
setDeleteDialogOpen(open);
|
||||
if (!open) setRoomToDelete(null);
|
||||
}}
|
||||
courseName={roomToDelete?.name}
|
||||
itemName={roomToDelete?.name}
|
||||
topicName="Raum"
|
||||
onConfirm={handleDeleteConfirm}
|
||||
isLoading={isDeleting}
|
||||
/>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue