import type { Meta, StoryObj } from '@storybook/nextjs-vite'; import type React from 'react'; import { ApprovalRequestMessage } from '../components/chat/approval-request-message'; import type { ApprovalRequestData } from '../components/chat/types'; /** * Single-command approval card (the legacy, non-batch variant of the Figma * "Command Block"). Renders a command bar, an optional structured field list * or explanation, and an Approve/Reject footer that flips to an * Approved/Rejected status tag once resolved. * * Newer surfaces use `ApprovalBatchMessage` (see the ApprovalBatchMessage * story) which additionally tracks per-tool execution + results. */ const LONG_COMMAND = `Get-CimInstance Win32_Process | Select-Object ProcessId, Name, Path, CommandLine | Where-Object { $_.Path -like 'C:\\Users\\Public\\*' }`; const baseData: ApprovalRequestData = { command: LONG_COMMAND, requestId: 'req-1', approvalType: 'ADMIN', fields: [ { label: 'Tool', value: 'OpenFrame RMM' }, { label: 'RunAsUser', value: 'False' }, { label: 'timeoutSeconds', value: '60' }, ], }; const constrainedDecorator = (width?: number) => // Named function expression: Storybook renders decorators as components, so // the name is what shows up in the React tree instead of `Anonymous`. function ConstrainedDecorator(Story: React.ComponentType) { return (