Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

markdownFileIcons.ts

13 lines524 Bytes

1import { Image, type ImageSourcePropType } from "react-native";
2​
3import type { MarkdownFileIcon } from "./markdownLinks";
4import { MARKDOWN_FILE_ICON_SOURCES } from "./markdownFileIcons.generated";
5​
6export function markdownFileIconSource(icon: MarkdownFileIcon): ImageSourcePropType {
7 return MARKDOWN_FILE_ICON_SOURCES[icon];
8}
9​
10/** URI for bundled icons rendered by native views. */
11export function markdownIconAssetUri(source: ImageSourcePropType): string | undefined {
12 return Image.resolveAssetSource(source)?.uri;