react-visual-feedback 1.4.6 → 1.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -153,7 +153,8 @@ function App() {
153
153
  | `isLoading` | `boolean` | `false` | Show loading state |
154
154
  | `onRefresh` | `() => void` | - | Callback for refresh button |
155
155
  | `title` | `string` | `'Feedback'` | Dashboard title |
156
- | `statuses` | `object` | `DEFAULT_STATUSES` | Custom status configurations |
156
+ | `statuses` | `object` | `DEFAULT_STATUSES` | Status configurations (label, color, icon) |
157
+ | `acceptableStatuses` | `string[]` | - | Array of status keys to show (e.g., `['open', 'resolved']`) |
157
158
  | `showAllStatuses` | `boolean` | `true` | Show all statuses in filter |
158
159
  | `error` | `string` | `null` | Error message to display |
159
160
 
@@ -593,42 +594,48 @@ app.patch('/api/feedback/:id/status', async (req, res) => {
593
594
 
594
595
  ### Custom Statuses
595
596
 
596
- You control which statuses are available. Pass your own `statuses` object to `FeedbackDashboard`. The widget will only show the statuses you provide:
597
+ You control which statuses are available. Pass your own `statuses` object and optionally `acceptableStatuses` array to control what's shown:
597
598
 
598
599
  ```jsx
599
600
  import { FeedbackDashboard } from 'react-visual-feedback';
600
601
 
601
- // Define ONLY the statuses you want to show
602
+ // Define your status configurations
602
603
  const myStatuses = {
603
- pending: {
604
- key: 'pending',
605
- label: 'Pending Review',
604
+ open: {
605
+ label: 'Open',
606
606
  color: '#f59e0b',
607
607
  bgColor: '#fef3c7',
608
608
  textColor: '#92400e',
609
- icon: 'AlertCircle'
609
+ icon: 'AlertCircle' // Optional - defaults to AlertCircle if not provided
610
610
  },
611
- approved: {
612
- key: 'approved',
613
- label: 'Approved',
611
+ in_progress: {
612
+ label: 'In Progress',
613
+ color: '#3b82f6',
614
+ bgColor: '#dbeafe',
615
+ textColor: '#1e40af',
616
+ icon: 'Play'
617
+ },
618
+ resolved: {
619
+ label: 'Resolved',
614
620
  color: '#10b981',
615
621
  bgColor: '#d1fae5',
616
622
  textColor: '#065f46',
617
623
  icon: 'CheckCircle'
618
- },
619
- rejected: {
620
- key: 'rejected',
621
- label: 'Rejected',
622
- color: '#ef4444',
623
- bgColor: '#fee2e2',
624
- textColor: '#991b1b',
625
- icon: 'Ban'
626
624
  }
627
625
  };
628
626
 
627
+ // Option 1: Show all statuses defined in myStatuses
628
+ <FeedbackDashboard
629
+ isOpen={true}
630
+ statuses={myStatuses}
631
+ // ... other props
632
+ />
633
+
634
+ // Option 2: Use acceptableStatuses to show only specific statuses
629
635
  <FeedbackDashboard
630
636
  isOpen={true}
631
- statuses={myStatuses} // Only these 3 statuses will be shown
637
+ statuses={myStatuses}
638
+ acceptableStatuses={['open', 'resolved']} // Only show these 2
632
639
  // ... other props
633
640
  />
634
641
  ```