feat(dashboard): restructure create product flow (#7374)

This commit is contained in:
Frane Polić
2024-05-28 13:59:02 +02:00
committed by GitHub
parent 76ec10f375
commit 6117af2704
46 changed files with 3161 additions and 395 deletions
@@ -0,0 +1,22 @@
import { MouseEvent, createContext } from "react"
import { Control, FieldValues, Path, UseFormRegister } from "react-hook-form"
import { CellCoords } from "./types"
type DataGridContextType<TForm extends FieldValues> = {
anchor: CellCoords | null
register: UseFormRegister<TForm>
control: Control<TForm>
onRegisterCell: (coordinates: CellCoords) => void
onUnregisterCell: (coordinates: CellCoords) => void
getMouseDownHandler: (
coordinates: CellCoords
) => (e: MouseEvent<HTMLElement>) => void
getMouseOverHandler: (
coordinates: CellCoords
) => ((e: MouseEvent<HTMLElement>) => void) | undefined
getOnChangeHandler: (field: Path<TForm>) => (next: any, prev: any) => void
}
export const DataGridContext = createContext<DataGridContextType<any> | null>(
null
)