@1771technologies/lytenyte-pro
Version:
Blazingly fast headless React data grid with 100s of features.
15 lines (14 loc) • 587 B
JavaScript
import { jsx as _jsx } from "react/jsx-runtime";
import { forwardRef } from "react";
import { useSortRowCtx } from "./context.js";
import { useSlot } from "@1771technologies/lytenyte-core/yinternal";
export const SortRemove = forwardRef(function SortRemove({ as, ...props }, forwarded) {
const row = useSortRowCtx();
const renderer = useSlot({
props: [typeof as !== "function" ? { onClick: row.onDelete } : {}, props],
ref: forwarded,
slot: as ?? _jsx("button", { children: "x" }),
state: { onAdd: row.onDelete },
});
return renderer;
});