@moontra/moonui-pro 2.11.4 → 2.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +80 -11
- package/dist/index.mjs +2314 -376
- package/package.json +1 -1
- package/src/components/file-upload/index.tsx +95 -40
- package/src/components/index.ts +2 -1
- package/src/components/kanban/add-card-modal.tsx +502 -0
- package/src/components/kanban/card-detail-modal.tsx +769 -0
- package/src/components/kanban/index.ts +13 -0
- package/src/components/kanban/kanban.tsx +1474 -0
- package/src/components/kanban/types.ts +111 -0
- package/src/components/ui/avatar.tsx +34 -19
- package/src/hooks/use-toast.ts +15 -0
- package/src/components/kanban/index.tsx +0 -434
|
@@ -0,0 +1,502 @@
|
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import React, { useState } from 'react'
|
|
4
|
+
import { Dialog, DialogContent, DialogHeader, DialogTitle, DialogFooter } from '../ui/dialog'
|
|
5
|
+
import { Button } from '../ui/button'
|
|
6
|
+
import { Input } from '../ui/input'
|
|
7
|
+
import { Textarea } from '../ui/textarea'
|
|
8
|
+
import { Label } from '../ui/label'
|
|
9
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '../ui/select'
|
|
10
|
+
import { Popover, PopoverContent, PopoverTrigger } from '../ui/popover'
|
|
11
|
+
import { Command, CommandEmpty, CommandGroup, CommandInput, CommandItem } from '../ui/command'
|
|
12
|
+
import { Calendar as CalendarComponent } from '../ui/calendar'
|
|
13
|
+
import { MoonUIAvatarPro, MoonUIAvatarFallbackPro, MoonUIAvatarImagePro, AvatarGroup as MoonUIAvatarGroupPro } from '../ui/avatar'
|
|
14
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '../ui/tabs'
|
|
15
|
+
import { Badge } from '../ui/badge'
|
|
16
|
+
import {
|
|
17
|
+
Calendar,
|
|
18
|
+
User,
|
|
19
|
+
Tag,
|
|
20
|
+
Flag,
|
|
21
|
+
Check,
|
|
22
|
+
ChevronDown,
|
|
23
|
+
FileText,
|
|
24
|
+
Star,
|
|
25
|
+
Zap,
|
|
26
|
+
Clock,
|
|
27
|
+
CheckSquare
|
|
28
|
+
} from 'lucide-react'
|
|
29
|
+
import { format } from 'date-fns'
|
|
30
|
+
import { cn } from '../../lib/utils'
|
|
31
|
+
import type { KanbanCard, KanbanAssignee, KanbanLabel } from './types'
|
|
32
|
+
|
|
33
|
+
interface AddCardModalProps {
|
|
34
|
+
isOpen: boolean
|
|
35
|
+
onClose: () => void
|
|
36
|
+
onAdd: (card: Partial<KanbanCard>) => void
|
|
37
|
+
columnId: string
|
|
38
|
+
columnTitle: string
|
|
39
|
+
availableAssignees?: KanbanAssignee[]
|
|
40
|
+
availableLabels?: KanbanLabel[]
|
|
41
|
+
templates?: Partial<KanbanCard>[]
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const PRIORITY_OPTIONS = [
|
|
45
|
+
{ value: 'low', label: 'Low Priority', icon: Flag, color: 'text-green-600' },
|
|
46
|
+
{ value: 'medium', label: 'Medium Priority', icon: Flag, color: 'text-yellow-600' },
|
|
47
|
+
{ value: 'high', label: 'High Priority', icon: Flag, color: 'text-orange-600' },
|
|
48
|
+
{ value: 'urgent', label: 'Urgent', icon: Zap, color: 'text-red-600' }
|
|
49
|
+
]
|
|
50
|
+
|
|
51
|
+
const CARD_TEMPLATES = [
|
|
52
|
+
{
|
|
53
|
+
name: 'Bug Report',
|
|
54
|
+
icon: Flag,
|
|
55
|
+
template: {
|
|
56
|
+
title: 'Bug: ',
|
|
57
|
+
description: '**Steps to Reproduce:**\n1. \n2. \n3. \n\n**Expected Behavior:**\n\n**Actual Behavior:**',
|
|
58
|
+
priority: 'high' as const,
|
|
59
|
+
tags: ['bug']
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
name: 'Feature Request',
|
|
64
|
+
icon: Star,
|
|
65
|
+
template: {
|
|
66
|
+
title: 'Feature: ',
|
|
67
|
+
description: '**User Story:**\nAs a [user type], I want [feature] so that [benefit].\n\n**Acceptance Criteria:**\n- [ ] ',
|
|
68
|
+
priority: 'medium' as const,
|
|
69
|
+
tags: ['feature']
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Task',
|
|
74
|
+
icon: CheckSquare,
|
|
75
|
+
template: {
|
|
76
|
+
title: 'Task: ',
|
|
77
|
+
description: '**Objective:**\n\n**Tasks:**\n- [ ] ',
|
|
78
|
+
priority: 'medium' as const,
|
|
79
|
+
tags: ['task']
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
name: 'User Story',
|
|
84
|
+
icon: User,
|
|
85
|
+
template: {
|
|
86
|
+
title: 'As a ',
|
|
87
|
+
description: '**Story:**\nAs a [user type]\nI want [functionality]\nSo that [benefit]\n\n**Acceptance Criteria:**\n- [ ] ',
|
|
88
|
+
priority: 'medium' as const,
|
|
89
|
+
tags: ['story']
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
]
|
|
93
|
+
|
|
94
|
+
const getInitials = (name: string) => {
|
|
95
|
+
return name.split(' ').map(n => n[0]).join('').toUpperCase()
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export function AddCardModal({
|
|
99
|
+
isOpen,
|
|
100
|
+
onClose,
|
|
101
|
+
onAdd,
|
|
102
|
+
columnId,
|
|
103
|
+
columnTitle,
|
|
104
|
+
availableAssignees = [],
|
|
105
|
+
availableLabels = [],
|
|
106
|
+
templates = []
|
|
107
|
+
}: AddCardModalProps) {
|
|
108
|
+
const [selectedTab, setSelectedTab] = useState('blank')
|
|
109
|
+
const [title, setTitle] = useState('')
|
|
110
|
+
const [description, setDescription] = useState('')
|
|
111
|
+
const [priority, setPriority] = useState<'low' | 'medium' | 'high' | 'urgent'>('medium')
|
|
112
|
+
const [assignees, setAssignees] = useState<KanbanAssignee[]>([])
|
|
113
|
+
const [labels, setLabels] = useState<KanbanLabel[]>([])
|
|
114
|
+
const [dueDate, setDueDate] = useState<Date | undefined>()
|
|
115
|
+
const [tags, setTags] = useState<string[]>([])
|
|
116
|
+
const [tagInput, setTagInput] = useState('')
|
|
117
|
+
|
|
118
|
+
const handleTemplateSelect = (template: Partial<KanbanCard>) => {
|
|
119
|
+
setTitle(template.title || '')
|
|
120
|
+
setDescription(template.description || '')
|
|
121
|
+
setPriority(template.priority || 'medium')
|
|
122
|
+
setTags(template.tags || [])
|
|
123
|
+
if (template.assignees) setAssignees(template.assignees)
|
|
124
|
+
if (template.labels) setLabels(template.labels)
|
|
125
|
+
if (template.dueDate) setDueDate(template.dueDate)
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
const handleSubmit = () => {
|
|
129
|
+
if (!title.trim()) return
|
|
130
|
+
|
|
131
|
+
const newCard: Partial<KanbanCard> = {
|
|
132
|
+
title: title.trim(),
|
|
133
|
+
description: description.trim() || undefined,
|
|
134
|
+
priority,
|
|
135
|
+
assignees: assignees.length > 0 ? assignees : undefined,
|
|
136
|
+
labels: labels.length > 0 ? labels : undefined,
|
|
137
|
+
dueDate,
|
|
138
|
+
tags: tags.length > 0 ? tags : undefined,
|
|
139
|
+
position: Date.now()
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
onAdd(newCard)
|
|
143
|
+
resetForm()
|
|
144
|
+
onClose()
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
const resetForm = () => {
|
|
148
|
+
setTitle('')
|
|
149
|
+
setDescription('')
|
|
150
|
+
setPriority('medium')
|
|
151
|
+
setAssignees([])
|
|
152
|
+
setLabels([])
|
|
153
|
+
setDueDate(undefined)
|
|
154
|
+
setTags([])
|
|
155
|
+
setTagInput('')
|
|
156
|
+
setSelectedTab('blank')
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
const handleAddTag = () => {
|
|
160
|
+
if (tagInput.trim() && !tags.includes(tagInput.trim())) {
|
|
161
|
+
setTags([...tags, tagInput.trim()])
|
|
162
|
+
setTagInput('')
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const allTemplates = [...CARD_TEMPLATES.map(t => ({ ...t.template, name: t.name, icon: t.icon })), ...templates]
|
|
167
|
+
|
|
168
|
+
return (
|
|
169
|
+
<Dialog open={isOpen} onOpenChange={onClose}>
|
|
170
|
+
<DialogContent className="max-w-2xl">
|
|
171
|
+
<DialogHeader>
|
|
172
|
+
<DialogTitle>Add Card to {columnTitle}</DialogTitle>
|
|
173
|
+
</DialogHeader>
|
|
174
|
+
|
|
175
|
+
<Tabs value={selectedTab} onValueChange={setSelectedTab}>
|
|
176
|
+
<TabsList className="grid w-full grid-cols-2">
|
|
177
|
+
<TabsTrigger value="blank">Blank Card</TabsTrigger>
|
|
178
|
+
<TabsTrigger value="template">From Template</TabsTrigger>
|
|
179
|
+
</TabsList>
|
|
180
|
+
|
|
181
|
+
<TabsContent value="blank" className="space-y-4">
|
|
182
|
+
<div className="space-y-4">
|
|
183
|
+
{/* Title */}
|
|
184
|
+
<div>
|
|
185
|
+
<Label htmlFor="title">Title *</Label>
|
|
186
|
+
<Input
|
|
187
|
+
id="title"
|
|
188
|
+
placeholder="Enter card title..."
|
|
189
|
+
value={title}
|
|
190
|
+
onChange={(e) => setTitle(e.target.value)}
|
|
191
|
+
autoFocus
|
|
192
|
+
/>
|
|
193
|
+
</div>
|
|
194
|
+
|
|
195
|
+
{/* Description */}
|
|
196
|
+
<div>
|
|
197
|
+
<Label htmlFor="description">Description</Label>
|
|
198
|
+
<Textarea
|
|
199
|
+
id="description"
|
|
200
|
+
placeholder="Add a more detailed description..."
|
|
201
|
+
value={description}
|
|
202
|
+
onChange={(e) => setDescription(e.target.value)}
|
|
203
|
+
className="min-h-[100px]"
|
|
204
|
+
/>
|
|
205
|
+
</div>
|
|
206
|
+
|
|
207
|
+
<div className="grid grid-cols-2 gap-4">
|
|
208
|
+
{/* Priority */}
|
|
209
|
+
<div>
|
|
210
|
+
<Label>Priority</Label>
|
|
211
|
+
<Select value={priority} onValueChange={(value: any) => setPriority(value)}>
|
|
212
|
+
<SelectTrigger>
|
|
213
|
+
<SelectValue />
|
|
214
|
+
</SelectTrigger>
|
|
215
|
+
<SelectContent>
|
|
216
|
+
{PRIORITY_OPTIONS.map((option) => (
|
|
217
|
+
<SelectItem key={option.value} value={option.value}>
|
|
218
|
+
<div className="flex items-center gap-2">
|
|
219
|
+
<option.icon className={cn("h-4 w-4", option.color)} />
|
|
220
|
+
<span>{option.label}</span>
|
|
221
|
+
</div>
|
|
222
|
+
</SelectItem>
|
|
223
|
+
))}
|
|
224
|
+
</SelectContent>
|
|
225
|
+
</Select>
|
|
226
|
+
</div>
|
|
227
|
+
|
|
228
|
+
{/* Due Date */}
|
|
229
|
+
<div>
|
|
230
|
+
<Label>Due Date</Label>
|
|
231
|
+
<Popover>
|
|
232
|
+
<PopoverTrigger asChild>
|
|
233
|
+
<Button variant="outline" className="w-full justify-start">
|
|
234
|
+
{dueDate ? (
|
|
235
|
+
<>
|
|
236
|
+
<Calendar className="mr-2 h-4 w-4" />
|
|
237
|
+
{format(dueDate, 'PPP')}
|
|
238
|
+
</>
|
|
239
|
+
) : (
|
|
240
|
+
<>
|
|
241
|
+
<Calendar className="mr-2 h-4 w-4" />
|
|
242
|
+
<span className="text-muted-foreground">Pick a date</span>
|
|
243
|
+
</>
|
|
244
|
+
)}
|
|
245
|
+
</Button>
|
|
246
|
+
</PopoverTrigger>
|
|
247
|
+
<PopoverContent className="w-auto p-0" align="start">
|
|
248
|
+
<CalendarComponent
|
|
249
|
+
mode="single"
|
|
250
|
+
selected={dueDate}
|
|
251
|
+
onSelect={(date) => {
|
|
252
|
+
if (date instanceof Date) {
|
|
253
|
+
setDueDate(date)
|
|
254
|
+
} else {
|
|
255
|
+
setDueDate(undefined)
|
|
256
|
+
}
|
|
257
|
+
}}
|
|
258
|
+
initialFocus
|
|
259
|
+
/>
|
|
260
|
+
</PopoverContent>
|
|
261
|
+
</Popover>
|
|
262
|
+
</div>
|
|
263
|
+
</div>
|
|
264
|
+
|
|
265
|
+
<div className="grid grid-cols-2 gap-4">
|
|
266
|
+
{/* Assignees */}
|
|
267
|
+
<div>
|
|
268
|
+
<Label>Assignees</Label>
|
|
269
|
+
<Popover>
|
|
270
|
+
<PopoverTrigger asChild>
|
|
271
|
+
<Button variant="outline" className="w-full justify-start">
|
|
272
|
+
{assignees.length > 0 ? (
|
|
273
|
+
<div className="flex items-center gap-2">
|
|
274
|
+
<MoonUIAvatarGroupPro max={2} size="xs">
|
|
275
|
+
{assignees.map((assignee) => (
|
|
276
|
+
<MoonUIAvatarPro key={assignee.id} className="h-5 w-5">
|
|
277
|
+
<MoonUIAvatarImagePro src={assignee.avatar} />
|
|
278
|
+
<MoonUIAvatarFallbackPro className="text-xs">
|
|
279
|
+
{getInitials(assignee.name)}
|
|
280
|
+
</MoonUIAvatarFallbackPro>
|
|
281
|
+
</MoonUIAvatarPro>
|
|
282
|
+
))}
|
|
283
|
+
</MoonUIAvatarGroupPro>
|
|
284
|
+
<span className="text-sm truncate">
|
|
285
|
+
{assignees.map(a => a.name).join(', ')}
|
|
286
|
+
</span>
|
|
287
|
+
</div>
|
|
288
|
+
) : (
|
|
289
|
+
<>
|
|
290
|
+
<User className="mr-2 h-4 w-4" />
|
|
291
|
+
<span className="text-muted-foreground">Select assignees</span>
|
|
292
|
+
</>
|
|
293
|
+
)}
|
|
294
|
+
</Button>
|
|
295
|
+
</PopoverTrigger>
|
|
296
|
+
<PopoverContent className="p-0" align="start">
|
|
297
|
+
<Command>
|
|
298
|
+
<CommandInput placeholder="Search people..." />
|
|
299
|
+
<CommandEmpty>No assignees found.</CommandEmpty>
|
|
300
|
+
<CommandGroup>
|
|
301
|
+
{availableAssignees.map((assignee) => {
|
|
302
|
+
const isSelected = assignees.some(a => a.id === assignee.id)
|
|
303
|
+
return (
|
|
304
|
+
<CommandItem
|
|
305
|
+
key={assignee.id}
|
|
306
|
+
onSelect={() => {
|
|
307
|
+
if (isSelected) {
|
|
308
|
+
setAssignees(assignees.filter(a => a.id !== assignee.id))
|
|
309
|
+
} else {
|
|
310
|
+
setAssignees([...assignees, assignee])
|
|
311
|
+
}
|
|
312
|
+
}}
|
|
313
|
+
>
|
|
314
|
+
<Check
|
|
315
|
+
className={cn(
|
|
316
|
+
"mr-2 h-4 w-4",
|
|
317
|
+
isSelected ? "opacity-100" : "opacity-0"
|
|
318
|
+
)}
|
|
319
|
+
/>
|
|
320
|
+
<MoonUIAvatarPro className="h-6 w-6 mr-2">
|
|
321
|
+
<MoonUIAvatarImagePro src={assignee.avatar} />
|
|
322
|
+
<MoonUIAvatarFallbackPro className="text-xs">
|
|
323
|
+
{getInitials(assignee.name)}
|
|
324
|
+
</MoonUIAvatarFallbackPro>
|
|
325
|
+
</MoonUIAvatarPro>
|
|
326
|
+
<span>{assignee.name}</span>
|
|
327
|
+
</CommandItem>
|
|
328
|
+
)
|
|
329
|
+
})}
|
|
330
|
+
</CommandGroup>
|
|
331
|
+
</Command>
|
|
332
|
+
</PopoverContent>
|
|
333
|
+
</Popover>
|
|
334
|
+
</div>
|
|
335
|
+
|
|
336
|
+
{/* Labels */}
|
|
337
|
+
<div>
|
|
338
|
+
<Label>Labels</Label>
|
|
339
|
+
<Popover>
|
|
340
|
+
<PopoverTrigger asChild>
|
|
341
|
+
<Button variant="outline" className="w-full justify-start">
|
|
342
|
+
{labels.length > 0 ? (
|
|
343
|
+
<div className="flex items-center gap-1 truncate">
|
|
344
|
+
{labels.slice(0, 2).map((label) => (
|
|
345
|
+
<div
|
|
346
|
+
key={label.id}
|
|
347
|
+
className="px-2 py-0.5 rounded text-xs text-white"
|
|
348
|
+
style={{ backgroundColor: label.color }}
|
|
349
|
+
>
|
|
350
|
+
{label.name}
|
|
351
|
+
</div>
|
|
352
|
+
))}
|
|
353
|
+
{labels.length > 2 && (
|
|
354
|
+
<span className="text-sm text-muted-foreground">
|
|
355
|
+
+{labels.length - 2} more
|
|
356
|
+
</span>
|
|
357
|
+
)}
|
|
358
|
+
</div>
|
|
359
|
+
) : (
|
|
360
|
+
<>
|
|
361
|
+
<Tag className="mr-2 h-4 w-4" />
|
|
362
|
+
<span className="text-muted-foreground">Select labels</span>
|
|
363
|
+
</>
|
|
364
|
+
)}
|
|
365
|
+
</Button>
|
|
366
|
+
</PopoverTrigger>
|
|
367
|
+
<PopoverContent className="p-3" align="start">
|
|
368
|
+
<div className="space-y-2">
|
|
369
|
+
{availableLabels.map((label) => {
|
|
370
|
+
const isSelected = labels.some(l => l.id === label.id)
|
|
371
|
+
return (
|
|
372
|
+
<div
|
|
373
|
+
key={label.id}
|
|
374
|
+
className={cn(
|
|
375
|
+
"flex items-center gap-2 p-2 rounded cursor-pointer hover:bg-muted",
|
|
376
|
+
isSelected && "bg-muted"
|
|
377
|
+
)}
|
|
378
|
+
onClick={() => {
|
|
379
|
+
if (isSelected) {
|
|
380
|
+
setLabels(labels.filter(l => l.id !== label.id))
|
|
381
|
+
} else {
|
|
382
|
+
setLabels([...labels, label])
|
|
383
|
+
}
|
|
384
|
+
}}
|
|
385
|
+
>
|
|
386
|
+
<div
|
|
387
|
+
className="w-6 h-6 rounded"
|
|
388
|
+
style={{ backgroundColor: label.color }}
|
|
389
|
+
/>
|
|
390
|
+
<span className="text-sm">{label.name}</span>
|
|
391
|
+
{isSelected && <Check className="h-4 w-4 ml-auto" />}
|
|
392
|
+
</div>
|
|
393
|
+
)
|
|
394
|
+
})}
|
|
395
|
+
</div>
|
|
396
|
+
</PopoverContent>
|
|
397
|
+
</Popover>
|
|
398
|
+
</div>
|
|
399
|
+
</div>
|
|
400
|
+
|
|
401
|
+
{/* Tags */}
|
|
402
|
+
<div>
|
|
403
|
+
<Label>Tags</Label>
|
|
404
|
+
<div className="space-y-2">
|
|
405
|
+
<div className="flex gap-2">
|
|
406
|
+
<Input
|
|
407
|
+
placeholder="Add a tag..."
|
|
408
|
+
value={tagInput}
|
|
409
|
+
onChange={(e) => setTagInput(e.target.value)}
|
|
410
|
+
onKeyDown={(e) => {
|
|
411
|
+
if (e.key === 'Enter') {
|
|
412
|
+
e.preventDefault()
|
|
413
|
+
handleAddTag()
|
|
414
|
+
}
|
|
415
|
+
}}
|
|
416
|
+
/>
|
|
417
|
+
<Button
|
|
418
|
+
type="button"
|
|
419
|
+
variant="outline"
|
|
420
|
+
onClick={handleAddTag}
|
|
421
|
+
disabled={!tagInput.trim()}
|
|
422
|
+
>
|
|
423
|
+
Add
|
|
424
|
+
</Button>
|
|
425
|
+
</div>
|
|
426
|
+
{tags.length > 0 && (
|
|
427
|
+
<div className="flex flex-wrap gap-2">
|
|
428
|
+
{tags.map((tag) => (
|
|
429
|
+
<Badge
|
|
430
|
+
key={tag}
|
|
431
|
+
variant="secondary"
|
|
432
|
+
className="cursor-pointer"
|
|
433
|
+
onClick={() => setTags(tags.filter(t => t !== tag))}
|
|
434
|
+
>
|
|
435
|
+
{tag}
|
|
436
|
+
<span className="ml-1 hover:text-destructive">×</span>
|
|
437
|
+
</Badge>
|
|
438
|
+
))}
|
|
439
|
+
</div>
|
|
440
|
+
)}
|
|
441
|
+
</div>
|
|
442
|
+
</div>
|
|
443
|
+
</div>
|
|
444
|
+
</TabsContent>
|
|
445
|
+
|
|
446
|
+
<TabsContent value="template" className="space-y-4">
|
|
447
|
+
<div className="grid grid-cols-2 gap-4">
|
|
448
|
+
{CARD_TEMPLATES.map((template) => (
|
|
449
|
+
<div
|
|
450
|
+
key={template.name}
|
|
451
|
+
className="p-4 border rounded-lg cursor-pointer hover:bg-muted/50 transition-colors"
|
|
452
|
+
onClick={() => {
|
|
453
|
+
handleTemplateSelect(template.template)
|
|
454
|
+
setSelectedTab('blank')
|
|
455
|
+
}}
|
|
456
|
+
>
|
|
457
|
+
<div className="flex items-center gap-3 mb-2">
|
|
458
|
+
<template.icon className="h-5 w-5 text-muted-foreground" />
|
|
459
|
+
<h4 className="font-medium">{template.name}</h4>
|
|
460
|
+
</div>
|
|
461
|
+
<p className="text-sm text-muted-foreground">
|
|
462
|
+
{template.name === 'Bug Report' && 'Track and fix bugs with detailed information'}
|
|
463
|
+
{template.name === 'Feature Request' && 'Plan new features with user stories'}
|
|
464
|
+
{template.name === 'Task' && 'Create actionable tasks with clear objectives'}
|
|
465
|
+
{template.name === 'User Story' && 'Define user needs and acceptance criteria'}
|
|
466
|
+
</p>
|
|
467
|
+
</div>
|
|
468
|
+
))}
|
|
469
|
+
{templates.map((template, index) => (
|
|
470
|
+
<div
|
|
471
|
+
key={`custom-${index}`}
|
|
472
|
+
className="p-4 border rounded-lg cursor-pointer hover:bg-muted/50 transition-colors"
|
|
473
|
+
onClick={() => {
|
|
474
|
+
handleTemplateSelect(template)
|
|
475
|
+
setSelectedTab('blank')
|
|
476
|
+
}}
|
|
477
|
+
>
|
|
478
|
+
<div className="flex items-center gap-3 mb-2">
|
|
479
|
+
<Star className="h-5 w-5 text-muted-foreground" />
|
|
480
|
+
<h4 className="font-medium">{template.title || `Template ${index + 1}`}</h4>
|
|
481
|
+
</div>
|
|
482
|
+
<p className="text-sm text-muted-foreground line-clamp-2">
|
|
483
|
+
{template.description || 'Custom template'}
|
|
484
|
+
</p>
|
|
485
|
+
</div>
|
|
486
|
+
))}
|
|
487
|
+
</div>
|
|
488
|
+
</TabsContent>
|
|
489
|
+
</Tabs>
|
|
490
|
+
|
|
491
|
+
<DialogFooter>
|
|
492
|
+
<Button variant="outline" onClick={onClose}>
|
|
493
|
+
Cancel
|
|
494
|
+
</Button>
|
|
495
|
+
<Button onClick={handleSubmit} disabled={!title.trim()}>
|
|
496
|
+
Add Card
|
|
497
|
+
</Button>
|
|
498
|
+
</DialogFooter>
|
|
499
|
+
</DialogContent>
|
|
500
|
+
</Dialog>
|
|
501
|
+
)
|
|
502
|
+
}
|