import { jsx as _jsx } from "react/jsx-runtime";
// (C) 2020-2026 GoodData Corporation
import { useMemo } from "react";
import { useIntl } from "react-intl";
import { ShareDialog } from "@gooddata/sdk-ui-kit";
import { useDashboardSelector } from "../../model/react/DashboardStoreProvider.js";
import { selectLocale, selectSettings } from "../../model/store/config/configSelectors.js";
/**
 * @alpha
 */
export function DefaultShareDialog({ workspace, backend, isVisible, sharedObject, currentUser, isLockingSupported, isCurrentUserWorkspaceManager, currentUserPermissions, dashboardFilters, dashboardParameters, isShareGrantHidden, applyShareGrantOnSelect, showDashboardShareLink, isGranteeShareLoading, onApply, onCancel, onError, onInteraction, onShareLinkCopy, }) {
    const locale = useDashboardSelector(selectLocale);
    const settings = useDashboardSelector(selectSettings);
    const dashboardLinkBasePath = settings.enableShellApplication_dashboards
        ? `/workspace/${workspace}/dashboards/`
        : undefined;
    const intl = useIntl();
    const labels = useMemo(() => ({
        accessTypeLabel: intl.formatMessage({ id: "dashboard.shareDialog.lock.label" }),
        accessRegimeLabel: intl.formatMessage({
            id: "dashboard.shareDialog.underLenientControl.label",
        }),
        removeAccessCreatorTooltip: intl.formatMessage({
            id: "dashboard.shareDialog.removeAccessCreatorTooltip",
        }),
        removeAccessGranteeTooltip: intl.formatMessage({
            id: "dashboard.shareDialog.removeAccessGranteeTooltip",
        }),
    }), [intl]);
    if (!isVisible) {
        return null;
    }
    return (_jsx(ShareDialog, { locale: locale, backend: backend, workspace: workspace, sharedObject: sharedObject, currentUser: currentUser, onApply: onApply, onCancel: onCancel, onError: onError, isLockingSupported: isLockingSupported, labels: labels, isCurrentUserWorkspaceManager: isCurrentUserWorkspaceManager, currentUserPermissions: currentUserPermissions, dashboardFilters: dashboardFilters, dashboardParameters: dashboardParameters, dashboardLinkBasePath: dashboardLinkBasePath, isShareGrantHidden: isShareGrantHidden, applyShareGrantOnSelect: applyShareGrantOnSelect, showDashboardShareLink: showDashboardShareLink, isGranteeShareLoading: isGranteeShareLoading, onInteraction: onInteraction, onShareLinkCopy: onShareLinkCopy }));
}
