@@ -34,13 +34,13 @@ import {
3434import { cn } from "@/lib/utils" ;
3535import type { Annotation , AnnotationFormData } from "@/types/annotations" ;
3636
37- interface EditAnnotationModalProps {
37+ type EditAnnotationModalProps = {
3838 isOpen : boolean ;
3939 annotation : Annotation | null ;
4040 onClose : ( ) => void ;
4141 onSave : ( id : string , updates : AnnotationFormData ) => Promise < void > ;
4242 isSaving ?: boolean ;
43- }
43+ } ;
4444
4545export function EditAnnotationModal ( {
4646 isOpen,
@@ -88,7 +88,9 @@ export function EditAnnotationModal({
8888 } ;
8989
9090 const handleSave = async ( ) => {
91- if ( ! annotation ) return ;
91+ if ( ! annotation ) {
92+ return ;
93+ }
9294
9395 const formData : AnnotationFormData = {
9496 text : sanitizeAnnotationText ( text ) ,
@@ -124,7 +126,9 @@ export function EditAnnotationModal({
124126 return `${ formatDate ( startDate ) } - ${ formatDate ( endDate ) } ` ;
125127 } ;
126128
127- if ( ! annotation ) return null ;
129+ if ( ! annotation ) {
130+ return null ;
131+ }
128132
129133 return (
130134 < Dialog onOpenChange = { onClose } open = { isOpen } >
@@ -220,19 +224,20 @@ export function EditAnnotationModal({
220224 { COMMON_ANNOTATION_TAGS . filter (
221225 ( tag ) => ! selectedTags . includes ( tag . value )
222226 ) . map ( ( tag ) => (
223- < button
227+ < Button
224228 className = "flex items-center gap-1 rounded-full border border-border bg-background px-3 py-1 text-xs transition-colors hover:bg-muted disabled:cursor-not-allowed disabled:opacity-50"
225229 disabled = { isSaving }
226230 key = { tag . value }
227231 onClick = { ( ) => addTag ( tag . value ) }
228232 style = { { borderColor : tag . color } }
233+ type = "button"
229234 >
230235 < div
231236 className = "h-2 w-2 rounded-full"
232237 style = { { backgroundColor : tag . color } }
233238 />
234239 { tag . label }
235- </ button >
240+ </ Button >
236241 ) ) }
237242 </ div >
238243 </ div >
@@ -244,7 +249,7 @@ export function EditAnnotationModal({
244249 < Label className = "font-medium" > Annotation Color</ Label >
245250 < div className = "flex gap-2" >
246251 { ANNOTATION_COLORS . map ( ( color ) => (
247- < button
252+ < Button
248253 className = { cn (
249254 "h-10 w-10 rounded-full border-2 transition-all hover:scale-110 disabled:cursor-not-allowed disabled:opacity-50 disabled:hover:scale-100" ,
250255 selectedColor === color . value
@@ -256,7 +261,14 @@ export function EditAnnotationModal({
256261 onClick = { ( ) => setSelectedColor ( color . value ) }
257262 style = { { backgroundColor : color . value } }
258263 title = { color . label }
259- />
264+ type = "button"
265+ >
266+ < div
267+ className = "h-2 w-2 rounded-full"
268+ style = { { backgroundColor : color . value } }
269+ />
270+ { color . label }
271+ </ Button >
260272 ) ) }
261273 </ div >
262274 </ div >
0 commit comments