Files
dify/web/app/components/workflow/skill/start-tab/template-search.tsx
yyh a91d709aa5 feat(skill-editor): add CategoryTabs and TemplateSearch to skill templates section
Add filter controls for skill templates:
- CategoryTabs: tab navigation with mock categories (All, Productivity, etc.)
- TemplateSearch: search input with accessibility attributes
- Grid layout fix to prevent tab width changes on font-weight switch

Update SectionHeader to accept className prop for flexible styling.
Add search placeholder i18n translations.
2026-01-23 14:39:53 +08:00

36 lines
1.0 KiB
TypeScript

'use client'
import type { FC } from 'react'
import { RiSearchLine } from '@remixicon/react'
import { memo } from 'react'
import { useTranslation } from 'react-i18next'
type TemplateSearchProps = {
value: string
onChange: (value: string) => void
}
const TemplateSearch: FC<TemplateSearchProps> = ({
value,
onChange,
}) => {
const { t } = useTranslation('workflow')
return (
<div className="flex shrink-0 items-center gap-0.5 rounded-md bg-components-input-bg-normal p-2">
<RiSearchLine className="size-4 shrink-0 text-text-placeholder" aria-hidden="true" />
<input
type="text"
name="template-search"
aria-label={t('skill.startTab.searchPlaceholder')}
className="system-sm-regular min-w-0 flex-1 bg-transparent px-1 text-text-secondary placeholder:text-components-input-text-placeholder focus:outline-none"
placeholder={t('skill.startTab.searchPlaceholder')}
value={value}
onChange={e => onChange(e.target.value)}
/>
</div>
)
}
export default memo(TemplateSearch)