mirror of
https://github.com/modrinth/code.git
synced 2026-08-31 12:05:53 +00:00
feat: moderation additions for shared instances (#7285)
* feat: moderation additions for shared instances * fix: lint --------- Co-authored-by: Prospector <6166773+Prospector@users.noreply.github.com>
This commit is contained in:
@@ -65,11 +65,17 @@ export interface SharedInstanceReportDetails {
|
||||
other_instances_loaded?: boolean
|
||||
}
|
||||
|
||||
const props = defineProps<{
|
||||
details: SharedInstanceReportDetails
|
||||
banPending?: boolean
|
||||
loadVersionContent?: (instanceId: string, version: number) => Promise<ContentItem[]>
|
||||
}>()
|
||||
const props = withDefaults(
|
||||
defineProps<{
|
||||
details: SharedInstanceReportDetails
|
||||
banPending?: boolean
|
||||
loadVersionContent?: (instanceId: string, version: number) => Promise<ContentItem[]>
|
||||
contextType?: 'report' | 'moderation'
|
||||
}>(),
|
||||
{
|
||||
contextType: 'report',
|
||||
},
|
||||
)
|
||||
|
||||
const emit = defineEmits<{
|
||||
banOwner: [owner: SharedInstanceReportUser]
|
||||
@@ -223,7 +229,7 @@ function formattedLoader(version: SharedInstanceReportVersion) {
|
||||
<span
|
||||
class="border-blue/60 rounded-full border border-solid bg-highlight-blue px-2 py-0.5 text-xs font-semibold text-blue"
|
||||
>
|
||||
Report context
|
||||
{{ contextType === 'report' ? 'Report context' : 'Moderation context' }}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -310,7 +316,10 @@ function formattedLoader(version: SharedInstanceReportVersion) {
|
||||
<div class="flex flex-wrap items-center gap-2">
|
||||
<span class="font-semibold text-contrast">Version {{ version.version }}</span>
|
||||
<span
|
||||
v-if="version.version === details.reported_version?.version"
|
||||
v-if="
|
||||
contextType === 'report' &&
|
||||
version.version === details.reported_version?.version
|
||||
"
|
||||
class="bg-orange-highlight rounded-full px-2 py-0.5 text-xs font-semibold text-orange"
|
||||
>
|
||||
Reported
|
||||
@@ -333,7 +342,11 @@ function formattedLoader(version: SharedInstanceReportVersion) {
|
||||
</div>
|
||||
</div>
|
||||
<span v-else class="text-sm text-secondary">
|
||||
No version was attached to this report.
|
||||
{{
|
||||
contextType === 'report'
|
||||
? 'No version was attached to this report.'
|
||||
: 'No version history is available.'
|
||||
}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user