Files
xLog/src/hooks/useEdtiorState.ts
T

22 lines
454 B
TypeScript

import { create } from "zustand"
export const initialEditorState = {
title: "",
publishedAt: "",
published: false,
excerpt: "",
slug: "",
tags: "",
content: "",
}
export type Values = typeof initialEditorState
export const useEditorState = create<
typeof initialEditorState & {
setValues: (values: Partial<typeof initialEditorState>) => void
}
>((set) => ({
...initialEditorState,
setValues: (values: any) => set(values),
}))