diff --git a/src/app/modules/components/NickSearch.tsx b/src/app/modules/components/NickSearch.tsx index 8f40f57..044d89c 100644 --- a/src/app/modules/components/NickSearch.tsx +++ b/src/app/modules/components/NickSearch.tsx @@ -4,6 +4,8 @@ import { useCallback, useState } from 'react'; import Style from "@/app/styles/nick_search.module.css"; import ApiManager from '../utils/apiManager'; import { debounce } from 'lodash'; +import Image from 'next/image'; +import { b64Prefix } from '@/app/workshop/[id]/bandage_engine'; export interface SearchResponse { status: string; @@ -42,16 +44,22 @@ const Searcher = ({ onChange }: SearchProps) => { const first = nick.name.slice(0, first_pos); const middle = nick.name.slice(first_pos, first_pos + nickname.length); const last = nick.name.slice(first_pos + nickname.length, nick.name.length); - const label = first_pos !== -1 ? <>{first}{middle}{last} : <>{nick.name}; + const label = first_pos !== -1 ? {first}{middle}{last} : <>{nick.name}; return { value: `${nick.name} – ${nick.uuid}`, label: -
- + {label}
@@ -95,10 +103,11 @@ const Searcher = ({ onChange }: SearchProps) => { onInputChange={(n, _) => onInput(n)} inputValue={input} onChange={(n, _) => { - if (n?.value) { + if (n.value) { setLoading(true); - const nickname = n?.value; - onChange(nickname.split(" – ").length > 1 ? nickname.split(" – ")[1] : nickname); + const nickname = n.value; + const parts = nickname.split(" – "); + onChange(parts.length > 1 ? parts[1] : nickname); setNickValue({ value: n.value, label:
{n.label}
}); } setLoading(false);