'use client' // Icon rendering for tree nodes (folder/file icons with dirty indicator) import type { FC } from 'react' import type { FileAppearanceType } from '@/app/components/base/file-uploader/types' import { RiFolderLine, RiFolderOpenLine } from '@remixicon/react' import { useTranslation } from 'react-i18next' import FileTypeIcon from '@/app/components/base/file-uploader/file-type-icon' import { cn } from '@/utils/classnames' import { getFileIconType } from '../utils/file-utils' type TreeNodeIconProps = { isFolder: boolean isOpen: boolean fileName: string isDirty: boolean onToggle?: (e: React.MouseEvent) => void } export const TreeNodeIcon: FC = ({ isFolder, isOpen, fileName, isDirty, onToggle, }) => { const { t } = useTranslation('workflow') if (isFolder) { return ( ) } const fileIconType = getFileIconType(fileName) return (
{isDirty && ( )}
) }