import { useEffect, useState } from "preact/hooks"; import { t } from "../../../services/i18n"; import FormTextBox from "../../react/FormTextBox"; import AbstractBulkAction, { ActionDefinition } from "../abstract_bulk_action"; import BulkAction, { BulkActionText } from "../BulkAction"; import { useSpacedUpdate } from "../../react/hooks"; function AddLabelBulkActionComponent({ bulkAction, actionDef }: { bulkAction: AbstractBulkAction, actionDef: ActionDefinition }) { const [ labelName, setLabelName ] = useState(actionDef.labelName ?? ""); const [ labelValue, setLabelValue ] = useState(actionDef.labelValue ?? ""); const spacedUpdate = useSpacedUpdate(() => bulkAction.saveAction({ labelName, labelValue })); useEffect(() => spacedUpdate.scheduleUpdate(), [labelName, labelValue]); return (

{t("add_label.help_text")}

  • {t("add_label.help_text_item1")}
  • {t("add_label.help_text_item2")}
{t("add_label.help_text_note")} } >
) } export default class AddLabelBulkAction extends AbstractBulkAction { doRender() { return ; } static get actionName() { return "addLabel"; } static get actionTitle() { return t("add_label.add_label"); } }