@@ -25,7 +25,6 @@ import {
2525 type TemplateMutationDTO ,
2626 type TemplateVersionDTO ,
2727} from "@/lib/templates/client/api" ;
28- import { deriveShortDescriptionFromMarkdown } from "@/lib/templates/form-helpers" ;
2928
3029type TemplateOwnerPanelProps = {
3130 initialTemplate : TemplateMutationDTO ;
@@ -50,7 +49,6 @@ function toMetadataValues(template: TemplateMutationDTO): TemplateMetadataFormVa
5049 slug : template . slug ,
5150 category : template . category as TemplateMetadataFormValues [ "category" ] ,
5251 description : template . description ,
53- shortDescription : template . shortDescription ,
5452 priceCents : template . priceCents ,
5553 } ;
5654}
@@ -84,11 +82,6 @@ export function TemplateOwnerPanel({
8482 const [ template , setTemplate ] = useState ( initialTemplate ) ;
8583 const [ versions , setVersions ] = useState ( initialVersions ) ;
8684 const [ metadata , setMetadata ] = useState ( ( ) => toMetadataValues ( initialTemplate ) ) ;
87- const [ isShortDescriptionManuallyEdited , setIsShortDescriptionManuallyEdited ] =
88- useState (
89- initialTemplate . shortDescription !==
90- deriveShortDescriptionFromMarkdown ( initialTemplate . description ) ,
91- ) ;
9285 const [ currentVersionNotesDraft , setCurrentVersionNotesDraft ] = useState (
9386 initialTemplate . versionNotes ?? "" ,
9487 ) ;
@@ -101,17 +94,12 @@ export function TemplateOwnerPanel({
10194 setVersions ( initialVersions ) ;
10295 setMetadata ( toMetadataValues ( initialTemplate ) ) ;
10396 setCurrentVersionNotesDraft ( initialTemplate . versionNotes ?? "" ) ;
104- setIsShortDescriptionManuallyEdited (
105- initialTemplate . shortDescription !==
106- deriveShortDescriptionFromMarkdown ( initialTemplate . description ) ,
107- ) ;
10897 } , [ initialTemplate , initialVersions ] ) ;
10998
11099 const canSaveEdits = template . status !== "deleted" ;
111100 const hasMetadataChanges =
112101 metadata . title !== template . title ||
113102 metadata . description !== template . description ||
114- metadata . shortDescription !== template . shortDescription ||
115103 metadata . category !== template . category ||
116104 metadata . priceCents !== template . priceCents ;
117105
@@ -136,9 +124,6 @@ export function TemplateOwnerPanel({
136124 ...( metadata . description !== template . description
137125 ? { description : metadata . description }
138126 : { } ) ,
139- ...( metadata . shortDescription !== template . shortDescription
140- ? { shortDescription : metadata . shortDescription }
141- : { } ) ,
142127 ...( metadata . category !== template . category
143128 ? { category : metadata . category }
144129 : { } ) ,
@@ -200,16 +185,6 @@ export function TemplateOwnerPanel({
200185 setMetadata ( ( current ) => ( {
201186 ...current ,
202187 description : value ,
203- shortDescription : isShortDescriptionManuallyEdited
204- ? current . shortDescription
205- : deriveShortDescriptionFromMarkdown ( value ) ,
206- } ) ) ;
207- } }
208- onShortDescriptionChange = { ( value ) => {
209- setIsShortDescriptionManuallyEdited ( true ) ;
210- setMetadata ( ( current ) => ( {
211- ...current ,
212- shortDescription : value ,
213188 } ) ) ;
214189 } }
215190 onPriceCentsChange = { ( value ) => {
0 commit comments