feat: 统一函数命名
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { createContext, useContext, useState, type ReactNode } from 'react'
|
||||
|
||||
import { type SysRole } from '@/schemas'
|
||||
import { type Role } from '@/schemas'
|
||||
|
||||
import type { Action } from '../constants'
|
||||
|
||||
@@ -11,11 +11,11 @@ type CrudContextType<T> = {
|
||||
setCurrentRow: (row: T | null) => void
|
||||
}
|
||||
|
||||
export const CrudContext = createContext<CrudContextType<SysRole> | null>(null)
|
||||
export const CrudContext = createContext<CrudContextType<Role> | null>(null)
|
||||
|
||||
export const CrudProvider = ({ children }: { children: ReactNode }) => {
|
||||
const [action, setAction] = useState<Action>(null)
|
||||
const [currentRow, setCurrentRow] = useState<SysRole | null>(null)
|
||||
const [currentRow, setCurrentRow] = useState<Role | null>(null)
|
||||
|
||||
return (
|
||||
<CrudContext value={{ action, setAction, currentRow, setCurrentRow }}>{children}</CrudContext>
|
||||
|
||||
Reference in New Issue
Block a user