feat: annotation UX improvements
- Custom calendar (DatePicker) instead of native date input - Custom dropdown (Select) instead of native select - EU date format (DD/MM/YYYY) in tooltips and form - Right-click context menu on chart to add annotations - Optional time field (HH:MM) for precise timestamps - Escape key to dismiss, loading state on save - Bump @ciphera-net/ui to 0.0.95
This commit is contained in:
@@ -238,13 +238,13 @@ export default function SiteDashboardPage() {
|
||||
const { data: annotations, mutate: mutateAnnotations } = useAnnotations(siteId, dateRange.start, dateRange.end)
|
||||
|
||||
// Annotation mutation handlers
|
||||
const handleCreateAnnotation = async (data: { date: string; text: string; category: string }) => {
|
||||
const handleCreateAnnotation = async (data: { date: string; time?: string; text: string; category: string }) => {
|
||||
await createAnnotation(siteId, { ...data, category: data.category as AnnotationCategory })
|
||||
mutateAnnotations()
|
||||
toast.success('Annotation added')
|
||||
}
|
||||
|
||||
const handleUpdateAnnotation = async (id: string, data: { date: string; text: string; category: string }) => {
|
||||
const handleUpdateAnnotation = async (id: string, data: { date: string; time?: string; text: string; category: string }) => {
|
||||
await updateAnnotation(siteId, id, { ...data, category: data.category as AnnotationCategory })
|
||||
mutateAnnotations()
|
||||
toast.success('Annotation updated')
|
||||
|
||||
Reference in New Issue
Block a user