UNPKG

@navikt/ds-react

Version:

React components from the Norwegian Labour and Welfare Administration.

28 lines 1.66 kB
var __rest = (this && this.__rest) || function (s, e) { var t = {}; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p]; if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) { if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]]; } return t; }; import React, { forwardRef } from "react"; import { PencilIcon } from "@navikt/aksel-icons"; import { Link } from "../../link/index.js"; import { useRenameCSS } from "../../theme/Theme.js"; import { CompositionWarning } from "../../util/composition-warning/index.js"; import { useI18n } from "../../util/i18n/i18n.hooks.js"; export const FormSummaryEditLink = forwardRef((_a, ref) => { var { children, className, as = "a" } = _a, rest = __rest(_a, ["children", "className", "as"]); const { cn } = useRenameCSS(); const translate = useI18n("FormSummary"); return (React.createElement(CompositionWarning.Forbidden, { name: "FormSummary.Header", message: "<FormSummary.EditLink> should not be placed in <FormSummary.Header> anymore. See https://aksel.nav.no/komponenter/core/formsummary" }, React.createElement(Link, Object.assign({ ref: ref, as: as }, rest, { className: cn("navds-form-summary__edit", className) }), React.createElement(PencilIcon, { "aria-hidden": true, fontSize: "1.5rem" }), children || translate("editAnswer")))); }); export default FormSummaryEditLink; //# sourceMappingURL=FormSummaryEditLink.js.map