// Copyright (c) Meta Platforms, Inc. and affiliates. 'use client'; import {useState} from 'react'; import {Toolbar} from '@astryxdesign/core/Toolbar'; import {Button} from '@astryxdesign/core/Button'; import {Icon} from '@astryxdesign/core/Icon'; import {Badge} from '@astryxdesign/core/Badge'; import {Table} from '@astryxdesign/core/Table'; import { useTableSelection, useTableSelectionState, } from '@astryxdesign/core/Table'; import {Stack} from '@astryxdesign/core/Layout'; import {useToast} from '@astryxdesign/core/Toast'; import {useImperativeAlertDialog} from '@astryxdesign/core/AlertDialog'; import { TrashIcon as DeleteIcon, ArchiveBoxIcon as ArchiveIcon, } from '@heroicons/react/24/outline'; const DATA = [ {id: '1', name: 'Alex Johnson', status: 'Active', role: 'Admin'}, {id: '2', name: 'Sam Rivera', status: 'Active', role: 'Editor'}, {id: '3', name: 'Jordan Lee', status: 'Invited', role: 'Viewer'}, {id: '4', name: 'Taylor Kim', status: 'Active', role: 'Editor'}, {id: '5', name: 'Casey Park', status: 'Active', role: 'Viewer'}, ]; export default function ToolbarBulkActions() { const showToast = useToast(); const confirm = useImperativeAlertDialog(); const [selectedKeys, setSelectedKeys] = useState>( () => new Set(['1', '3', '5']), ); const {selectionConfig} = useTableSelectionState({ data: DATA, idKey: 'id', selectedKeys, setSelectedKeys, }); const selectionPlugin = useTableSelection(selectionConfig); return ( {selectedKeys.size > 0 && (