import { useUIState } from "src/useUIState"; import { ReplicacheMutators, useReplicache } from "src/replicache"; import { ToolbarButton } from "./index"; import { copySelection } from "src/utils/copySelection"; import { useSmoker } from "components/Toast"; import { getBlocksWithType } from "src/hooks/queries/useBlocks"; import { Replicache } from "replicache"; import { LockBlockButton } from "./LockBlockButton"; import { Props } from "components/Icons/Props"; import { TextAlignmentButton } from "./TextAlignmentToolbar"; import { getSortedSelection } from "components/SelectionManager"; export const MultiselectToolbar = (props: { setToolbarState: ( state: "areYouSure" | "multiselect" | "text-alignment", ) => void; }) => { const { rep } = useReplicache(); const smoker = useSmoker(); const handleCopy = async (event: React.MouseEvent) => { if (!rep) return; const [sortedSelection] = await getSortedSelection(rep); await copySelection(rep, sortedSelection); smoker({ position: { x: event.clientX, y: event.clientY }, text: "Copied to clipboard", }); }; return (