use textarea instead of input for ai prompt
This commit is contained in:
@@ -12,6 +12,7 @@ import { IcsFilePicker } from '@/components/ics-file-picker'
|
|||||||
import { addEvent, deleteEvent, getAllEvents, clearEvents, getDB } from '@/lib/db'
|
import { addEvent, deleteEvent, getAllEvents, clearEvents, getDB } from '@/lib/db'
|
||||||
import { parseICS, generateICS } from '@/lib/ical'
|
import { parseICS, generateICS } from '@/lib/ical'
|
||||||
import type { CalendarEvent } from '@/lib/types'
|
import type { CalendarEvent } from '@/lib/types'
|
||||||
|
import { Textarea } from '@/components/ui/textarea'
|
||||||
|
|
||||||
export default function HomePage() {
|
export default function HomePage() {
|
||||||
const [events, setEvents] = useState<CalendarEvent[]>([])
|
const [events, setEvents] = useState<CalendarEvent[]>([])
|
||||||
@@ -221,30 +222,36 @@ export default function HomePage() {
|
|||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
{/* AI Toolbar */}
|
{/* AI Toolbar */}
|
||||||
<div className="flex flex-wrap gap-2 mb-4 items-center">
|
<div className="flex flex-row gap-4 mb-4 items-start">
|
||||||
<Input
|
<div className='w-full'>
|
||||||
className="flex-1"
|
<Textarea
|
||||||
placeholder='Describe event for AI to create'
|
className="wrap-anywhere min-h-12"
|
||||||
value={aiPrompt}
|
placeholder='Describe event for AI to create'
|
||||||
onChange={e => setAiPrompt(e.target.value)}
|
value={aiPrompt}
|
||||||
/>
|
onChange={e => setAiPrompt(e.target.value)}
|
||||||
<Button onClick={handleAiCreate} disabled={aiLoading}>
|
/>
|
||||||
{aiLoading ? 'Thinking...' : 'AI Create'}
|
</div>
|
||||||
</Button>
|
<div className='flex flex-row gap-2 pt-1.5'>
|
||||||
<Button variant="secondary" onClick={handleAiSummarize} disabled={aiLoading}>
|
<Button onClick={handleAiCreate} disabled={aiLoading}>
|
||||||
{aiLoading ? 'Summarizing...' : 'AI Summarize'}
|
{aiLoading ? 'Thinking...' : 'AI Create'}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button variant="secondary" onClick={handleAiSummarize} disabled={aiLoading}>
|
||||||
|
{aiLoading ? 'Summarizing...' : 'AI Summarize'}
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Summary Panel */}
|
{/* Summary Panel */}
|
||||||
{summary && (
|
{
|
||||||
<Card className="p-4 mb-4 bg-gray-50 border border-gray-200">
|
summary && (
|
||||||
<div className="text-sm text-gray-500 mb-1">
|
<Card className="p-4 mb-4 bg-gray-50 border border-gray-200">
|
||||||
Summary updated {summaryUpdated}
|
<div className="text-sm text-gray-500 mb-1">
|
||||||
</div>
|
Summary updated {summaryUpdated}
|
||||||
<div>{summary}</div>
|
</div>
|
||||||
</Card>
|
<div>{summary}</div>
|
||||||
)}
|
</Card>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
{/* Control Toolbar */}
|
{/* Control Toolbar */}
|
||||||
<div className="flex flex-wrap gap-2 mb-4">
|
<div className="flex flex-wrap gap-2 mb-4">
|
||||||
@@ -327,6 +334,6 @@ export default function HomePage() {
|
|||||||
</DialogFooter>
|
</DialogFooter>
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
</Dialog>
|
</Dialog>
|
||||||
</div>
|
</div >
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
18
src/components/ui/textarea.tsx
Normal file
18
src/components/ui/textarea.tsx
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
import * as React from "react"
|
||||||
|
|
||||||
|
import { cn } from "@/lib/utils"
|
||||||
|
|
||||||
|
function Textarea({ className, ...props }: React.ComponentProps<"textarea">) {
|
||||||
|
return (
|
||||||
|
<textarea
|
||||||
|
data-slot="textarea"
|
||||||
|
className={cn(
|
||||||
|
"border-input placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",
|
||||||
|
className
|
||||||
|
)}
|
||||||
|
{...props}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
export { Textarea }
|
||||||
Reference in New Issue
Block a user