rusackas commented on code in PR #37502:
URL: https://github.com/apache/superset/pull/37502#discussion_r2738011763


##########
superset-frontend/packages/superset-ui-core/src/components/MetadataBar/MetadataBar.stories.tsx:
##########
@@ -98,3 +106,85 @@ Basic.argTypes = {
     },
   },
 };
+
+// Interactive story for docs generation
+export const InteractiveMetadataBar = (args: MetadataBarProps) => (
+  <MetadataBar {...args} />
+);
+
+InteractiveMetadataBar.args = {};

Review Comment:
   Fixed — added `items` to `InteractiveMetadataBar.args` with the same data 
used in `staticProps`. The story will render properly in both Storybook and the 
docs site.



##########
superset-frontend/packages/superset-ui-core/src/components/FaveStar/FaveStar.stories.tsx:
##########
@@ -71,3 +71,44 @@ export const Default: Story = {
     </div>
   ),
 };
+
+export const InteractiveFaveStar: Story = {
+  args: {
+    itemId: 1,
+    isStarred: false,
+    showTooltip: true,
+  },

Review Comment:
   Fixed — added `saveFaveStar: () => {}` to `InteractiveFaveStar.args`.



##########
superset-frontend/packages/superset-ui-core/src/components/FaveStar/FaveStar.stories.tsx:
##########
@@ -71,3 +71,44 @@ export const Default: Story = {
     </div>
   ),
 };
+
+export const InteractiveFaveStar: Story = {
+  args: {
+    itemId: 1,
+    isStarred: false,
+    showTooltip: true,
+  },
+  argTypes: {
+    isStarred: {
+      control: 'boolean',
+      description: 'Whether the item is currently starred.',
+    },
+    showTooltip: {
+      control: 'boolean',
+      description: 'Show tooltip on hover.',
+    },
+  },
+  render: args => (
+    <span style={{ display: 'inline-block' }}>
+      <FaveStar {...args} />
+    </span>
+  ),
+  parameters: {
+    docs: {
+      description: {
+        story: 'A star icon for marking items as favorites.',
+      },
+      liveExample: `function Demo() {
+  const [starred, setStarred] = React.useState(false);
+  return (
+    <FaveStar
+      itemId={1}
+      isStarred={starred}
+      showTooltip
+      fetchFaveStar={() => setStarred(!starred)}

Review Comment:
   Fixed — replaced the inline arrow with `React.useCallback` and moved the 
toggle to `saveFaveStar` (the click handler) instead of `fetchFaveStar` (the 
effect-bound fetch).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to