mirror of
https://github.com/HKUDS/DeepTutor.git
synced 2026-12-02 00:19:26 +08:00
28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
'use client'
|
|
import Link from 'next/link'
|
|
import { Plus } from 'lucide-react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import Tooltip from '@/shared/ui/Tooltip'
|
|
import { pageActionClass } from '@/components/layout/FeaturePage'
|
|
import { useSidebarDrawer } from '@/components/layout/AppShell'
|
|
import { scopedUrl, activeWorkspaceId } from '@/lib/workspace-scope'
|
|
|
|
/** All creation entry points share a bookmarkable page instead of a transient menu. */
|
|
export function LearningCreateMenu({ compact = false }: { compact?: boolean }) {
|
|
const { t } = useTranslation()
|
|
const drawer = useSidebarDrawer()
|
|
return (
|
|
<Tooltip label={t('navigation.createLearning')}>
|
|
<Link
|
|
href={scopedUrl('/learning/new', activeWorkspaceId())}
|
|
aria-label={t('navigation.createLearning')}
|
|
onClick={() => drawer?.close()}
|
|
className={compact ? 'dt-nav-icon' : pageActionClass()}
|
|
>
|
|
<Plus size={compact ? 17 : 15} />
|
|
{!compact && t('navigation.createLearning')}
|
|
</Link>
|
|
</Tooltip>
|
|
)
|
|
}
|