mirror of
https://github.com/SamyRai/tercul-frontend.git
synced 2025-12-27 04:51:34 +00:00
Revert tag input and text editor; Adjust work editor form field controls
Reverted tag input and text editor, and added type assertion to `form.control` and disabled text editor if `readOnly` or `isLoading` in `work-editor.tsx`. Replit-Commit-Author: Agent Replit-Commit-Session-Id: bddfbb2b-6d6b-457b-b18c-05792cdaa035 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/39b5c689-6e8a-4d5a-9792-69cc81a56534/471b78ae-f1c4-48c0-b482-9e0163e9a44a.jpg
This commit is contained in:
parent
47743e62cc
commit
9bc163b285
@ -202,7 +202,8 @@ export function WorkEditor({
|
||||
authorId: data.authorId,
|
||||
subtitle: data.subtitle,
|
||||
description: data.description,
|
||||
publicationYear: data.publicationYear,
|
||||
// Convert publication year to number if available
|
||||
publicationYear: data.publicationYear ? Number(data.publicationYear) : undefined,
|
||||
content: data.content,
|
||||
status: data.status,
|
||||
genres: selectedGenres.map(tag => tag.value),
|
||||
@ -315,7 +316,7 @@ export function WorkEditor({
|
||||
<CardContent className="space-y-4">
|
||||
{/* Title */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={form.control as any}
|
||||
name="title"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
@ -334,7 +335,7 @@ export function WorkEditor({
|
||||
|
||||
{/* Subtitle */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={form.control as any}
|
||||
name="subtitle"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
@ -353,7 +354,7 @@ export function WorkEditor({
|
||||
|
||||
{/* Author */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={form.control as any}
|
||||
name="authorId"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
@ -387,7 +388,7 @@ export function WorkEditor({
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
{/* Language */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={form.control as any}
|
||||
name="language"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
@ -420,7 +421,7 @@ export function WorkEditor({
|
||||
|
||||
{/* Publication Year */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={form.control as any}
|
||||
name="publicationYear"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
@ -440,7 +441,7 @@ export function WorkEditor({
|
||||
|
||||
{/* Description */}
|
||||
<FormField
|
||||
control={form.control}
|
||||
control={form.control as any}
|
||||
name="description"
|
||||
render={({ field }) => (
|
||||
<FormItem>
|
||||
@ -606,7 +607,7 @@ export function WorkEditor({
|
||||
value={workContent}
|
||||
onChange={setWorkContent}
|
||||
placeholder="Enter your work content here..."
|
||||
readOnly={readOnly || isLoading}
|
||||
disabled={readOnly || isLoading}
|
||||
/>
|
||||
</div>
|
||||
</CardContent>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user