import type { Post } from "../classes/post"; import { EmbedDataType } from "../enums"; import { MAX_LENGTH } from "../limits"; import type { BaseElementProps } from "../types"; import { isAltEditableType } from "../utils/helpers"; import { PostContent } from "./post"; interface EditedPostProps extends BaseElementProps { post: Post; }; export function PostAltTextEdit(props: EditedPostProps) { const post: Post = props.post; let num = -1; const embedAltTextEdit = post.embedContent?.map((embedData) => { ++num; if (!isAltEditableType(embedData.type)) return; const thumbURL = (embedData.type == EmbedDataType.Video) ? "thumbs/video.png" : `preview/file/${embedData.content}`; return (
); }); const altEditBlock = embedAltTextEdit; if (altEditBlock?.at(0) === undefined || altEditBlock.length <= 0) { return null; } return (