Use item in TextView when given

This commit is contained in:
Maximilian Harz 2025-02-17 17:53:00 +01:00
parent b9295128fd
commit 10e81c38c2

View File

@ -15,19 +15,26 @@ import { decodeTag } from '#utils/FormatTags'
import { hashTagRegex } from '#utils/HashTagRegex' import { hashTagRegex } from '#utils/HashTagRegex'
import { fixUrls, mailRegex } from '#utils/ReplaceURLs' import { fixUrls, mailRegex } from '#utils/ReplaceURLs'
import type { Item } from '#types/Item'
import type { Tag } from '#types/Tag' import type { Tag } from '#types/Tag'
export const TextView = ({ export const TextView = ({
item,
itemId, itemId,
text, text,
truncate = false, truncate = false,
rawText, rawText,
}: { }: {
item: Item
itemId: string itemId: string
text?: string text?: string
truncate?: boolean truncate?: boolean
rawText?: string rawText?: string
}) => { }) => {
if (item) {
text = item.text
itemId = item.id
}
const tags = useTags() const tags = useTags()
const addFilterTag = useAddFilterTag() const addFilterTag = useAddFilterTag()