@@ -4,6 +4,7 @@ import { DictionaryCard } from '@/components/dictionary/dictionary-card'
44import { Button } from '@/components/ui/button'
55import { fetchAdminSaes } from '@/api/admin'
66import { DictionarySelect } from '@/components/dictionary/dictionary-select'
7+ import { LabeledInput } from '@/components/ui/labeled-input'
78
89export const Route = createFileRoute ( '/dictionaries/$dictionaryName/' ) ( {
910 component : DictionaryIndexPage ,
@@ -23,6 +24,7 @@ function DictionaryIndexPage() {
2324 const { saes, dictionaryName } = Route . useLoaderData ( )
2425
2526 const [ selectedDictionary , setSelectedDictionary ] = useState ( dictionaryName )
27+ const [ selectedFeatureIndex , setSelectedFeatureIndex ] = useState ( '0' )
2628
2729 return (
2830 < div className = "h-full overflow-y-auto pt-4 pb-20 px-20 flex flex-col items-center gap-6" >
@@ -46,6 +48,31 @@ function DictionaryIndexPage() {
4648 Go
4749 </ Button >
4850 ) }
51+
52+ < div className = "w-[100px] ml-4" >
53+ < LabeledInput
54+ label = "Index"
55+ id = "feature-input"
56+ value = { selectedFeatureIndex }
57+ onChange = { ( e ) => setSelectedFeatureIndex ( e . target . value ) }
58+ />
59+ </ div >
60+
61+ { ! isNaN ( Number ( selectedFeatureIndex ) ) ? (
62+ < Link
63+ to = "/dictionaries/$dictionaryName/features/$featureIndex"
64+ params = { {
65+ dictionaryName : selectedDictionary ,
66+ featureIndex : selectedFeatureIndex ,
67+ } }
68+ >
69+ < Button className = "h-12 px-4" > View Feature</ Button >
70+ </ Link >
71+ ) : (
72+ < Button className = "h-12 px-4" disabled >
73+ View Feature
74+ </ Button >
75+ ) }
4976 </ div >
5077 </ div >
5178 < DictionaryCard dictionaryName = { dictionaryName } />
0 commit comments