import{_ as _extends}from"./_rollupPluginBabelHelpers-B5fk9IVe.js";import React__default,{useState,useEffect}from"react";import PropTypes from"prop-types";import{u as useDataListContext}from"./DataList.component-BYn0Gl6b.js";import{D as DataListCheckboxCell}from"./DataListCheckboxCell.component-BXti2wK7.js";const datalistrowbasestyles=`
	jn-flex
	jn-rounded-[3px]
	jn-border
	jn-border-theme-datalist-row
	jn-mb-2
`,rowselectedstyle=`
	jn-bg-theme-datalistrow-selected
`,DataListRow=a=>{let{selected:b,disabled:c,onChange:d,className:f="",children:g=null,...e}=a;const h=useDataListContext()||{},i=h.selectable,[j,k]=useState(!1);useEffect(()=>{k(b)},[b]);return React__default.createElement("li",_extends({className:`juno-datalist-row ${datalistrowbasestyles} ${i&&j?rowselectedstyle:""}${f}`},e),i?React__default.createElement(DataListCheckboxCell,{selected:b,disabled:c,onChange:a=>{k(!j),d(a)}}):null,g)};DataListRow.propTypes={className:PropTypes.string,children:PropTypes.node,selected:PropTypes.bool,disabled:PropTypes.bool,onChange:PropTypes.func};export{DataListRow as D};