import { Button, DataTableBulkActionItem, defineDashboardExtension } from '@vendure/dashboard'; import { InfoIcon } from 'lucide-react'; import { toast } from 'sonner'; import { TextareaCustomField } from './custom-form-components'; import { CustomWidget } from './custom-widget'; import { reviewDetail } from './review-detail'; import { reviewList } from './review-list'; export default defineDashboardExtension({ routes: [reviewList, reviewDetail], widgets: [ { id: 'custom-widget', name: 'Custom Widget', component: CustomWidget, defaultSize: { w: 3, h: 3 }, }, ], actionBarItems: [ { label: 'Custom Action Bar Item', component: props => { return ( ); }, locationId: 'product-detail', }, ], pageBlocks: [ { id: 'my-block', component: ({ context }) => { return
Here is my custom block!
; }, title: 'My Custom Block', location: { pageId: 'product-detail', column: 'side', position: { blockId: 'main-form', order: 'after' }, }, }, ], customFormComponents: [ { id: 'textarea', component: TextareaCustomField, }, ], dataTables: [ { pageId: 'product-list', bulkActions: [ { component: props => ( { console.log('Selection:', props.selection); toast.message(`There are ${props.selection.length} selected items`); }} label="My Custom Action" icon={InfoIcon} /> ), }, ], }, ], });