import { ArgType } from "@storybook/addons" ; const argControl = ( target ) => { if ( target === null ) { return { type : null } ; } else if ( Array . isArray ( target ) ) { const type = target . length > 4 ? "select" : "radio" ; return { type , options : target } ; } else if ( typeof target === "object" ) { const options = Object . keys ( target as any ) ; const type = options . length > 4 ? "select" : "radio" ; return { type , options } ; } else { return { type : target } ; } } ; export const utilsArg = ( target , category ? ) : ArgType => { const table = category ? { category } : undefined ; const control = argControl ( target ) ; const options = control . options ; delete control . options ; return { options , control , table } ; } ;