import { FolderPlus, Pencil, Trash2, ChevronRight } from 'lucide-react' import { useLocale } from '@meshkee/dashboard-ui' import type { Category } from '../types/category' import { useT } from '../i18n/useT' import { Tooltip } from './Tooltip' import styles from './CategoryRow.module.css' interface BlogCategoryRowProps { category: Category depth: number hasChildren: boolean expanded: boolean onToggle: () => void onAddSub: (id: string) => void onEdit: (id: string) => void onRemove: (id: string) => void } export function BlogCategoryRow({ category, depth, hasChildren, expanded, onToggle, onAddSub, onEdit, onRemove, }: BlogCategoryRowProps) { const t = useT() const { locale } = useLocale() const isFa = locale === 'fa' const primaryName = isFa ? category.nameFa || category.nameEn : category.nameEn const secondaryName = isFa ? category.nameFa ? category.nameEn : '' : category.nameFa return (
{ if (e.key === 'Enter' || e.key === ' ') { e.preventDefault() onToggle() } } : undefined } role={hasChildren ? 'button' : undefined} tabIndex={hasChildren ? 0 : undefined} aria-expanded={hasChildren ? expanded : undefined} >
{primaryName} {secondaryName ? ( <> ยท {secondaryName} ) : null} {hasChildren && ( )}
{category.description &&

{category.description}

}
) }