ยฉ 2026 Hedgehog Software, LLC
export function CollapsibleControl(props: CollapsibleControlProps) { const [prop, others] = splitProps(props, ['as', 'onClick']); const ctx = useCollapsible(); console.log(prop.onClick); console.log(prop.as); return ( <Dynamic {...others} component={prop.as} id={'collapsible-control'.concat(ctx.id)} onClick={(e: MouseEvent) => { console.log('is being clicked?'); prop.onClick?.(e); ctx.toggle(); }} /> ); }
const TableFilterButton = () => ( <Button color='outline' size='sqr_md' > <Show when={numFilters() > 0}> <span class={ 'bg-orange-600 text-white rounded-full w-4 h-4 p-2.5 text-xs leading-none inline-flex justify-center items-center me-2' } > {numFilters()} </span> </Show> <span class='hidden md:block'>Filtrar por</span> <ConfigIcon className='w-5 h-5 md:ms-2 text-gray-600' /> </Button> ); <CollapsibleControl onClick={handleFilterByPress} as={TableFilterButton} />
<Dynamic component={someComponent} someProp="someValue" />