mirror of
https://github.com/linkwarden/linkwarden.git
synced 2026-06-28 14:55:49 +00:00
- Updated ConfirmationModal to use a callback for toggleModal. - Modified DeleteUserModal to handle admin checks more robustly. - Removed unnecessary config usage in SettingsSidebar and updated links. - Cleaned up TagListing by removing unused context logging. - Enhanced admin page to redirect non-admin users to the dashboard. - Simplified API for archiving links by removing unused actions. - Updated billing settings page for better UI consistency. - Adjusted password settings page for responsive design. - Deleted obsolete worker-console page and redirected to background-jobs. - Added new background-jobs page with worker stats and preservation actions. - Introduced new API endpoints for fetching worker stats and managing preservations. - Created new hooks for managing worker-related actions in the router. - Updated localization files to reflect new UI changes and actions. - Removed deprecated preservation file handling from filesystem management.
51 lines
1.2 KiB
TypeScript
51 lines
1.2 KiB
TypeScript
import React, { ReactNode } from "react";
|
|
import { Button } from "@/components/ui/button";
|
|
import { useTranslation } from "next-i18next";
|
|
import Modal from "./Modal";
|
|
import { Separator } from "./ui/separator";
|
|
|
|
type Props = {
|
|
toggleModal: Function;
|
|
className?: string;
|
|
children: ReactNode;
|
|
title: string;
|
|
onConfirmed: Function;
|
|
dismissible?: boolean;
|
|
};
|
|
|
|
export default function ConfirmationModal({
|
|
toggleModal,
|
|
className,
|
|
children,
|
|
title,
|
|
onConfirmed,
|
|
}: Props) {
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<Modal toggleModal={() => toggleModal()} className={className}>
|
|
<p className="text-xl font-thin">{title}</p>
|
|
<Separator className="mb-3 mt-1" />
|
|
{children}
|
|
<div className="w-full flex items-center justify-end gap-2 mt-3">
|
|
<Button
|
|
variant="ghost"
|
|
className="hover:bg-base-200"
|
|
onClick={() => toggleModal()}
|
|
>
|
|
{t("cancel")}
|
|
</Button>
|
|
<Button
|
|
variant="destructive"
|
|
onClick={async () => {
|
|
await onConfirmed();
|
|
toggleModal();
|
|
}}
|
|
>
|
|
{t("confirm")}
|
|
</Button>
|
|
</div>
|
|
</Modal>
|
|
);
|
|
}
|