feat(frontend): partial user lookup
This commit is contained in:
parent
9d3d46bf33
commit
db22e35f0d
7 changed files with 157 additions and 3 deletions
|
@ -1,5 +1,5 @@
|
|||
import type { Member } from "./member";
|
||||
import type { PartialMember, PartialUser, User } from "./user";
|
||||
import type { AuthMethod, PartialMember, PartialUser, User } from "./user";
|
||||
|
||||
export type CreateReportRequest = {
|
||||
reason: ReportReason;
|
||||
|
@ -70,3 +70,13 @@ export type PartialReport = {
|
|||
context: string | null;
|
||||
target_type: "USER" | "MEMBER";
|
||||
};
|
||||
|
||||
export type QueriedUser = {
|
||||
user: User;
|
||||
member_list_hidden: boolean;
|
||||
last_active: string;
|
||||
last_sid_reroll: string;
|
||||
suspended: boolean;
|
||||
deleted: boolean;
|
||||
auth_methods?: AuthMethod[];
|
||||
};
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
import { t } from "$lib/i18n";
|
||||
import type { AuthMethod } from "$api/models";
|
||||
|
||||
type Props = { method: AuthMethod; canRemove: boolean };
|
||||
let { method, canRemove }: Props = $props();
|
||||
type Props = { method: AuthMethod; canRemove: boolean; showType?: boolean };
|
||||
let { method, canRemove, showType }: Props = $props();
|
||||
|
||||
let name = $derived(
|
||||
method.type === "EMAIL" ? method.remote_id : (method.remote_username ?? method.remote_id),
|
||||
|
@ -14,6 +14,9 @@
|
|||
<div class="list-group-item">
|
||||
<div class="row">
|
||||
<div class="col">
|
||||
{#if showType}
|
||||
<code>{method.type}</code>:
|
||||
{/if}
|
||||
{name}
|
||||
{#if showId}({method.remote_id}){/if}
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue