@premieroctet/next-admin
Version:
Next-Admin provides a customizable and turnkey admin dashboard for applications built with Next.js and powered by the Prisma ORM. It aims to simplify the development process by providing a turnkey admin system that can be easily integrated into your proje
25 lines (24 loc) • 1.09 kB
JavaScript
import { jsx } from "react/jsx-runtime";
import { cloneElement } from "react";
import { twMerge } from "tailwind-merge";
import external_BaseInput_mjs_default from "../BaseInput.mjs";
import external_DndItem_mjs_default from "../DndItem.mjs";
const ScalarArrayFieldItem = ({ value, onChange, disabled, onRemoveClick, id, scalarType, customInput = /*#__PURE__*/ jsx(external_BaseInput_mjs_default, {}) })=>{
const renderInput = ()=>/*#__PURE__*/ cloneElement(customInput, {
...customInput.props,
value,
onChange: (evt)=>onChange(evt.target.value),
disabled,
className: twMerge("w-full", customInput.props.className),
type: "number" === scalarType ? "number" : "text"
});
return /*#__PURE__*/ jsx(external_DndItem_mjs_default, {
sortable: !disabled,
deletable: !disabled,
onRemoveClick: onRemoveClick,
label: renderInput(),
value: id
});
};
const ScalarArray_ScalarArrayFieldItem = ScalarArrayFieldItem;
export { ScalarArray_ScalarArrayFieldItem as default };