mirror of
https://github.com/flarum/core.git
synced 2025-08-08 09:26:34 +02:00
@@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2019-2021 Stichting Flarum (Flarum Foundation)
|
||||
Copyright (c) 2019-2024 Stichting Flarum (Flarum Foundation)
|
||||
Copyright (c) 2014-2019 Toby Zerner (toby.zerner@gmail.com)
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
|
@@ -10,6 +10,7 @@ import type Post from 'flarum/common/models/Post';
|
||||
import type FlagListState from '../states/FlagListState';
|
||||
import type Flag from '../models/Flag';
|
||||
import { Page } from 'flarum/common/states/PaginatedListState';
|
||||
import ItemList from 'flarum/common/utils/ItemList';
|
||||
|
||||
export interface IFlagListAttrs extends ComponentAttrs {
|
||||
state: FlagListState;
|
||||
@@ -27,6 +28,7 @@ export default class FlagList<CustomAttrs extends IFlagListAttrs = IFlagListAttr
|
||||
<HeaderList
|
||||
className="FlagList"
|
||||
title={app.translator.trans('flarum-flags.forum.flagged_posts.title')}
|
||||
controls={this.controlItems()}
|
||||
hasItems={state.hasItems()}
|
||||
loading={state.isLoading()}
|
||||
emptyText={app.translator.trans('flarum-flags.forum.flagged_posts.empty_text')}
|
||||
@@ -37,6 +39,12 @@ export default class FlagList<CustomAttrs extends IFlagListAttrs = IFlagListAttr
|
||||
);
|
||||
}
|
||||
|
||||
controlItems() {
|
||||
const items = new ItemList();
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
content(state: FlagListState) {
|
||||
if (!state.isLoading() && state.hasItems()) {
|
||||
return state.getPages().map((page: Page<Flag>) => {
|
||||
|
Reference in New Issue
Block a user