from django.contrib import admin
from .models import Discussion, Message, MessageAttachment, MessageReaction


@admin.register(Discussion)
class DiscussionAdmin(admin.ModelAdmin):
    list_display = ['id', 'board_type', 'lead', 'project', 'created_at']
    list_filter = ['board_type']


@admin.register(Message)
class MessageAdmin(admin.ModelAdmin):
    list_display = ['id', 'discussion', 'author', 'is_pinned', 'is_deleted', 'created_at']
    list_filter = ['is_pinned', 'is_deleted']
    search_fields = ['content']


@admin.register(MessageAttachment)
class MessageAttachmentAdmin(admin.ModelAdmin):
    list_display = ['file_name', 'message', 'uploaded_at']


@admin.register(MessageReaction)
class MessageReactionAdmin(admin.ModelAdmin):
    list_display = ['message', 'user', 'emoji']
