import { ComponentChildren } from "preact"; import { memo } from "preact/compat"; import AbstractBulkAction from "./abstract_bulk_action"; import HelpRemoveButtons from "../react/HelpRemoveButtons"; interface BulkActionProps { label: string | ComponentChildren; children?: ComponentChildren; helpText?: ComponentChildren; bulkAction: AbstractBulkAction; } // Define styles as constants to prevent recreation const flexContainerStyle = { display: "flex", alignItems: "center" } as const; const labelStyle = { marginRight: "10px" } as const; const textStyle = { marginRight: "10px", marginInlineStart: "10px" } as const; const BulkAction = memo(({ label, children, helpText, bulkAction }: BulkActionProps) => { return (
{label}
{children}
bulkAction?.deleteAction()} /> ); }); export default BulkAction; export const BulkActionText = memo(({ text }: { text: string }) => { return (
{text}
); });