mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
* fix(topic): handleSelectLearningState missing depth * fix(link): use active index instead of native focus * chore(palette): use atom for maintain state * chore(link): prevent keydown if command palette active * fix: responsive link item * chore: add active item index state to LinkRoute * fix: ability to press enter go to edit mode
30 lines
927 B
TypeScript
30 lines
927 B
TypeScript
"use client"
|
|
|
|
import { LinkHeader } from "@/components/routes/link/header"
|
|
import { LinkList } from "@/components/routes/link/list"
|
|
import { LinkManage } from "@/components/routes/link/manage"
|
|
import { useQueryState } from "nuqs"
|
|
import { useEffect, useState } from "react"
|
|
import { useAtom } from "jotai"
|
|
import { linkEditIdAtom } from "@/store/link"
|
|
import { LinkBottomBar } from "./bottom-bar"
|
|
|
|
export function LinkRoute() {
|
|
const [, setEditId] = useAtom(linkEditIdAtom)
|
|
const [nuqsEditId] = useQueryState("editId")
|
|
const [activeItemIndex, setActiveItemIndex] = useState<number | null>(null)
|
|
|
|
useEffect(() => {
|
|
setEditId(nuqsEditId)
|
|
}, [nuqsEditId, setEditId])
|
|
|
|
return (
|
|
<div className="flex h-full flex-auto flex-col overflow-hidden">
|
|
<LinkHeader />
|
|
<LinkManage />
|
|
<LinkList key={nuqsEditId} activeItemIndex={activeItemIndex} setActiveItemIndex={setActiveItemIndex} />
|
|
<LinkBottomBar />
|
|
</div>
|
|
)
|
|
}
|