From 325b4a2b4a1dc2fba6a72f0a10dc88b98f57f05c Mon Sep 17 00:00:00 2001
From: tobi <31960611+tsmethurst@users.noreply.github.com>
Date: Wed, 24 Jul 2024 10:40:56 +0200
Subject: [feature] Allow user to set "bot" flag; show bot icon on profile
 (#3135)

* [feature] Allow user to set "bot" flag; show bot icon on profile

* tweak

* update customs
---
 web/source/settings/components/profile.tsx | 22 +++++++++++++++++++---
 1 file changed, 19 insertions(+), 3 deletions(-)

(limited to 'web/source/settings/components/profile.tsx')

diff --git a/web/source/settings/components/profile.tsx b/web/source/settings/components/profile.tsx
index 24cb3c4c2..ee50a6d33 100644
--- a/web/source/settings/components/profile.tsx
+++ b/web/source/settings/components/profile.tsx
@@ -19,7 +19,7 @@
 
 import React from "react";
 
-export default function FakeProfile({ avatar, header, display_name, username, role }) {
+export default function FakeProfile({ avatar, header, display_name, bot, username, role }) {
 	return ( // Keep in sync with web/template/profile.tmpl
 		<div className="profile">
 			<div className="profile-header">
@@ -35,8 +35,24 @@ export default function FakeProfile({ avatar, header, display_name, username, ro
 					<dl className="namerole">
 						<dt className="sr-only">Display name</dt>
 						<dd className="displayname text-cutoff">{display_name.trim().length > 0 ? display_name : username}</dd>
-						<dt className="sr-only">Username</dt>
-						<dd className="username text-cutoff">@{username}</dd>
+						<div className="bot-username-wrapper">
+							{ bot && <>
+								<dt className="sr-only">Bot account</dt>
+								<dd>
+									<span className="sr-only">true</span>
+									<div
+										className="bot-legend-wrapper"
+										aria-hidden="true"
+										title="This is a bot account."
+									>
+										<i className="bot-icon fa fa-microchip"></i>
+										<span className="bot-legend">bot</span>
+									</div>
+								</dd>
+							</>}
+							<dt className="sr-only">Username</dt>
+							<dd className="username text-cutoff">@{username}</dd>
+						</div>
 						<dt className="sr-only">Role</dt>
 						{
 							(role && role.name != "user") ?
-- 
cgit v1.2.3

