Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion frontend/src/components/EmbedPreview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ const EmbedPreview: FC<EmbedPreviewProps> = ({ embed, raw = false }) => {
const authorIconUrl = previewAvatarUrl(embed.author?.icon_url);
const authorUrl = previewAvatarUrl(embed.author?.url);
const footerIconUrl = previewAvatarUrl(embed.footer?.icon_url);
const titleUrl = previewAvatarUrl(embed.url);

// Group fields into rows: inline fields share a row (max 3), non-inline get their own
const fieldRows: EmbedField[][] = [];
Expand Down Expand Up @@ -90,7 +91,17 @@ const EmbedPreview: FC<EmbedPreviewProps> = ({ embed, raw = false }) => {
<span className="text-sm font-semibold">{embed.author.name}</span>
</div>
) : null}
<DiscordText raw={raw} content={embed.title || ""} className="text-sm font-bold" />
{titleUrl && isSafeUrl(titleUrl) && embed.title ? (
<a href={titleUrl} target="_blank" rel="noopener noreferrer">
<DiscordText
raw={raw}
content={embed.title}
className="text-sm font-bold text-[#00a8fc] hover:underline"
/>
</a>
) : (
<DiscordText raw={raw} content={embed.title || ""} className="text-sm font-bold" />
)}
{embed.description && (
<DiscordText raw={raw} content={embed.description} className="text-sm pt-2" />
)}
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/components/modals/TagEditorModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -291,6 +291,14 @@ const TagEditorModal: FC<TagEditorModalProps> = ({
/>
</div>

<TextInput
label="Title URL"
placeholder="e.g. https://example.com"
value={embed.url || ""}
onChange={(v) => setEmbed((prev) => ({ ...prev, url: v }))}
maxLength={EMBED_LIMITS.URL}
/>

<Textarea
label="Description"
value={embed.description || ""}
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/pages/manage/kb/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,14 @@ const CreateKBArticlePage: FC = () => {
/>
</div>

<TextInput
label="Title URL"
placeholder="e.g. https://example.com"
value={embed.url || ""}
onChange={(v) => setEmbed((prev) => ({ ...prev, url: v }))}
maxLength={EMBED_LIMITS.URL}
/>

<Textarea
label="Embed Description"
value={embed.description || ""}
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/pages/manage/kb/edit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,14 @@ const EditKBArticlePage: FC = () => {
/>
</div>

<TextInput
label="Title URL"
placeholder="e.g. https://example.com"
value={embed.url || ""}
onChange={(v) => setEmbed((prev) => ({ ...prev, url: v }))}
maxLength={EMBED_LIMITS.URL}
/>

<Textarea
label="Embed Description"
value={embed.description || ""}
Expand Down
Loading