import { jsx as _jsx } from "react/jsx-runtime";
import { IntlProvider } from "react-intl";
import { DefaultLocale, resolveLocale, useResolveMessages } from "@gooddata/sdk-ui";
import { DEFAULT_MESSAGES, resolveMessages } from "../../internal/utils/translations.js";
const formats = {
    time: {
        hhmm: {
            hour: "numeric",
            minute: "numeric",
        },
    },
    date: {
        shortWithoutYear: {
            day: "numeric",
            month: "short",
        },
        shortWithYear: {
            day: "numeric",
            month: "short",
            year: "numeric",
        },
    },
};
/**
 * @internal
 */
export function IntlWrapper({ children, locale = DefaultLocale }) {
    const messages = useResolveMessages(resolveLocale(locale), resolveMessages, DEFAULT_MESSAGES);
    if (!messages[locale]) {
        return null;
    }
    return (_jsx(IntlProvider, { locale: locale, messages: messages[locale], formats: formats, children: children }));
}
//# sourceMappingURL=IntlWrapper.js.map