// This function generates data structure required to hide specified
// prop from individual stories. Key 'table' is where specified key
// is disabled.
//
// The above is documented here:
// https://storybook.js.org/docs/react/essentials/controls#disable-controls-for-specific-properties
//
// The expected usage looks as follows:
//
// <Meta
//   title="Components/MyComponent"
//   component={MyComponent}
//   argTypes={{
//     label: {
//       control: {
//         type: "text",
//       },
//       table: {
//         disable: true,
//       },
//     },
//   }}
// />
export const excludeControls = (...args: string[]) =>
  args.reduce(
    (prev, acc) => ({ ...prev, [acc]: { table: { disable: true } } }),
    {},
  );
