fix(auth): unify scheme creator display

This commit is contained in:
2026-07-30 14:21:20 +08:00
parent 1d7e07174f
commit 8836549697
17 changed files with 106 additions and 18 deletions
@@ -42,6 +42,7 @@ import { bbox, featureCollection } from "@turf/turf";
import Timeline from "@components/olmap/core/Controls/Timeline";
import { SchemeRecord, SchemaItem } from "./types";
import { FLOW_DISPLAY_UNIT } from "@utils/units";
import { useSchemeCreatorName } from "@components/olmap/core/useSchemeCreatorName";
interface SchemeQueryProps {
schemes?: SchemeRecord[];
@@ -100,6 +101,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
const [highlightFeatures, setHighlightFeatures] = useState<Feature[]>([]);
const [mapContainer, setMapContainer] = useState<HTMLElement | null>(null);
const creatorName = useSchemeCreatorName();
const { open } = useNotification();
const map = useMap();
@@ -290,7 +292,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
id: item.scheme_id,
schemeName: item.scheme_name,
type: item.scheme_type,
user: item.username,
username: item.username,
create_time: item.create_time,
startTime: item.scheme_start_time,
schemeDetail: item.scheme_detail,
@@ -479,7 +481,8 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
variant="caption"
className="text-gray-500 block"
>
: {scheme.user} · : {formatTime(scheme.create_time)}
: {creatorName(scheme.username)} · :{" "}
{formatTime(scheme.create_time)}
</Typography>
</Box>
<Box className="flex gap-1 ml-2">
@@ -579,7 +582,7 @@ const SchemeQuery: React.FC<SchemeQueryProps> = ({
:
</Typography>
<Typography variant="caption" className="font-medium text-gray-900">
{scheme.user}
{creatorName(scheme.username)}
</Typography>
</Box>