mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2025-07-29 23:00:08 +02:00

Prevent browser translation of stuff that shouldn't be translated in IDE page GitOrigin-RevId: 96a75b51c3c8efc4cbcec7eb17d9e331a03e2c96
44 lines
984 B
TypeScript
44 lines
984 B
TypeScript
import { useSelectableEntity } from '../contexts/file-tree-selectable'
|
|
import FileTreeIcon from './file-tree-icon'
|
|
import FileTreeItemInner from './file-tree-item/file-tree-item-inner'
|
|
|
|
function FileTreeDoc({
|
|
name,
|
|
id,
|
|
isFile,
|
|
isLinkedFile,
|
|
}: {
|
|
name: string
|
|
id: string
|
|
isFile?: boolean
|
|
isLinkedFile?: boolean
|
|
}) {
|
|
const type = isFile ? 'file' : 'doc'
|
|
|
|
const { isSelected, props: selectableEntityProps } = useSelectableEntity(
|
|
id,
|
|
type
|
|
)
|
|
|
|
return (
|
|
<li
|
|
// eslint-disable-next-line jsx-a11y/role-has-required-aria-props
|
|
role="treeitem"
|
|
// aria-selected is provided in selectableEntityProps
|
|
{...selectableEntityProps}
|
|
aria-label={name}
|
|
tabIndex={0}
|
|
translate="no"
|
|
>
|
|
<FileTreeItemInner
|
|
id={id}
|
|
name={name}
|
|
type={type}
|
|
isSelected={isSelected}
|
|
icons={<FileTreeIcon isLinkedFile={isLinkedFile} name={name} />}
|
|
/>
|
|
</li>
|
|
)
|
|
}
|
|
|
|
export default FileTreeDoc
|