Add BMAD framework, authentication, and new features
This commit is contained in:
@@ -5,14 +5,18 @@ import { useSearchParams } from 'next/navigation'
|
||||
import { Note } from '@/lib/types'
|
||||
import { getNotes, searchNotes } from '@/app/actions/notes'
|
||||
import { NoteInput } from '@/components/note-input'
|
||||
import { NoteGrid } from '@/components/note-grid'
|
||||
import { MasonryGrid } from '@/components/masonry-grid'
|
||||
import { useLabels } from '@/context/LabelContext'
|
||||
import { useReminderCheck } from '@/hooks/use-reminder-check'
|
||||
|
||||
export default function HomePage() {
|
||||
const searchParams = useSearchParams()
|
||||
const [notes, setNotes] = useState<Note[]>([])
|
||||
const [isLoading, setIsLoading] = useState(true)
|
||||
const { labels } = useLabels()
|
||||
|
||||
// Enable reminder notifications
|
||||
useReminderCheck(notes)
|
||||
|
||||
useEffect(() => {
|
||||
const loadNotes = async () => {
|
||||
@@ -25,19 +29,19 @@ export default function HomePage() {
|
||||
|
||||
// Filter by selected labels
|
||||
if (labelFilter.length > 0) {
|
||||
allNotes = allNotes.filter(note =>
|
||||
note.labels?.some(label => labelFilter.includes(label))
|
||||
allNotes = allNotes.filter((note: any) =>
|
||||
note.labels?.some((label: string) => labelFilter.includes(label))
|
||||
)
|
||||
}
|
||||
|
||||
// Filter by color (filter notes that have labels with this color)
|
||||
if (colorFilter) {
|
||||
const labelNamesWithColor = labels
|
||||
.filter(label => label.color === colorFilter)
|
||||
.map(label => label.name)
|
||||
.filter((label: any) => label.color === colorFilter)
|
||||
.map((label: any) => label.name)
|
||||
|
||||
allNotes = allNotes.filter(note =>
|
||||
note.labels?.some(label => labelNamesWithColor.includes(label))
|
||||
allNotes = allNotes.filter((note: any) =>
|
||||
note.labels?.some((label: string) => labelNamesWithColor.includes(label))
|
||||
)
|
||||
}
|
||||
|
||||
@@ -54,7 +58,7 @@ export default function HomePage() {
|
||||
{isLoading ? (
|
||||
<div className="text-center py-8 text-gray-500">Loading...</div>
|
||||
) : (
|
||||
<NoteGrid notes={notes} />
|
||||
<MasonryGrid notes={notes} />
|
||||
)}
|
||||
</main>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user