2025-10-18 19:32:05 +00:00
|
|
|
import type { Doc, Id } from "@fileone/convex/dataModel"
|
|
|
|
|
import type { FileSystemItem } from "@fileone/convex/filesystem"
|
2025-09-19 23:01:44 +00:00
|
|
|
import type { RowSelectionState } from "@tanstack/react-table"
|
|
|
|
|
import { atom } from "jotai"
|
2025-09-20 22:43:31 +00:00
|
|
|
import type { FileDragInfo } from "../../files/use-file-drop"
|
2025-09-19 23:01:44 +00:00
|
|
|
|
2025-09-28 15:45:49 +00:00
|
|
|
export const contextMenuTargeItemsAtom = atom<FileSystemItem[]>([])
|
2025-09-19 23:01:44 +00:00
|
|
|
export const optimisticDeletedItemsAtom = atom(
|
|
|
|
|
new Set<Id<"files"> | Id<"directories">>(),
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
export const selectedFileRowsAtom = atom<RowSelectionState>({})
|
|
|
|
|
|
|
|
|
|
export const itemBeingRenamedAtom = atom<{
|
2025-09-28 15:45:49 +00:00
|
|
|
originalItem: FileSystemItem
|
2025-09-19 23:01:44 +00:00
|
|
|
name: string
|
|
|
|
|
} | null>(null)
|
2025-09-20 19:55:20 +00:00
|
|
|
|
|
|
|
|
export const openedFileAtom = atom<Doc<"files"> | null>(null)
|
2025-09-20 22:25:01 +00:00
|
|
|
|
2025-09-20 22:43:31 +00:00
|
|
|
export const dragInfoAtom = atom<FileDragInfo | null>(null)
|