mirror of
https://github.com/outline/outline.git
synced 2026-11-27 16:08:58 +03:00
26 lines
809 B
TypeScript
26 lines
809 B
TypeScript
import { PlusIcon } from "outline-icons";
|
|
import * as React from "react";
|
|
import stores from "~/stores";
|
|
import { DataAttributeNew } from "~/components/DataAttribute/DataAttributeNew";
|
|
import { createAction } from "..";
|
|
import { SettingsSection } from "../sections";
|
|
|
|
export const createDataAttribute = createAction({
|
|
name: ({ t }) => t("New attribute"),
|
|
analyticsName: "New attribute",
|
|
section: SettingsSection,
|
|
icon: <PlusIcon />,
|
|
keywords: "create",
|
|
visible: () =>
|
|
stores.policies.abilities(stores.auth.team?.id || "").createDataAttribute,
|
|
perform: ({ t, event }) => {
|
|
event?.preventDefault();
|
|
event?.stopPropagation();
|
|
|
|
stores.dialogs.openModal({
|
|
title: t("New attribute"),
|
|
content: <DataAttributeNew onSubmit={stores.dialogs.closeAllModals} />,
|
|
});
|
|
},
|
|
});
|