{
    "version": "1.0.0",
    "layout_name": "sirsoft-sample.admin_index",
    "permissions": [],
    "extends": "_admin_base",
    "meta": {
        "title": "$t:sirsoft-sample.admin.index.title",
        "description": "$t:sirsoft-sample.admin.index.description",
        "auth_required": true
    },
    "data_sources": [
        {
            "id": "items",
            "label_key": "$t:editor.data_source.items",
            "endpoint": "/api/modules/sirsoft-sample/admin/items",
            "method": "GET"
        }
    ],
    "slots": {
        "content": [
            {
                "id": "sample_list_container",
                "type": "basic",
                "name": "Div",
                "props": {
                    "className": "p-4 sm:p-6 lg:p-8 bg-purple-50 dark:bg-purple-900/20 min-h-screen"
                },
                "children": [
                    {
                        "id": "override_indicator",
                        "type": "basic",
                        "name": "Div",
                        "props": {
                            "className": "mb-4 px-3 py-2 bg-purple-100 dark:bg-purple-800/50 text-purple-700 dark:text-purple-200 text-xs rounded-lg"
                        },
                        "text": "[Template Override] This layout is overridden by sirsoft-admin_basic template"
                    },
                    {
                        "id": "page_header",
                        "type": "basic",
                        "name": "Div",
                        "props": {
                            "className": "flex-between mb-6"
                        },
                        "children": [
                            {
                                "id": "page_title",
                                "type": "basic",
                                "name": "H1",
                                "props": {
                                    "className": "text-xl sm:text-2xl font-semibold text-purple-900 dark:text-purple-100"
                                },
                                "text": "$t:sirsoft-sample.admin.index.title"
                            },
                            {
                                "id": "create_button",
                                "type": "basic",
                                "name": "Button",
                                "props": {
                                    "className": "px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors shadow-lg shadow-purple-200 dark:shadow-purple-900/50",
                                    "href": "/admin/sirsoft-sample/items/create"
                                },
                                "text": "$t:sirsoft-sample.admin.index.create_button"
                            }
                        ]
                    },
                    {
                        "id": "items_table_card",
                        "type": "basic",
                        "name": "Div",
                        "props": {
                            "className": "bg-white dark:bg-gray-800 rounded-xl shadow-lg border-2 border-purple-200 dark:border-purple-700 overflow-hidden"
                        },
                        "children": [
                            {
                                "id": "items_table",
                                "type": "basic",
                                "name": "Table",
                                "props": {
                                    "className": "w-full"
                                },
                                "children": [
                                    {
                                        "id": "table_header",
                                        "type": "basic",
                                        "name": "Thead",
                                        "props": {
                                            "className": "bg-purple-100 dark:bg-purple-900/50"
                                        },
                                        "children": [
                                            {
                                                "id": "header_row",
                                                "type": "basic",
                                                "name": "Tr",
                                                "children": [
                                                    {
                                                        "id": "th_id",
                                                        "type": "basic",
                                                        "name": "Th",
                                                        "props": {
                                                            "className": "px-6 py-3 text-left text-xs font-medium text-purple-600 dark:text-purple-300 uppercase tracking-wider"
                                                        },
                                                        "text": "$t:sirsoft-sample.admin.index.table.id"
                                                    },
                                                    {
                                                        "id": "th_name",
                                                        "type": "basic",
                                                        "name": "Th",
                                                        "props": {
                                                            "className": "px-6 py-3 text-left text-xs font-medium text-purple-600 dark:text-purple-300 uppercase tracking-wider"
                                                        },
                                                        "text": "$t:sirsoft-sample.admin.index.table.name"
                                                    },
                                                    {
                                                        "id": "th_status",
                                                        "type": "basic",
                                                        "name": "Th",
                                                        "props": {
                                                            "className": "px-6 py-3 text-left text-xs font-medium text-purple-600 dark:text-purple-300 uppercase tracking-wider"
                                                        },
                                                        "text": "$t:sirsoft-sample.admin.index.table.status"
                                                    },
                                                    {
                                                        "id": "th_created_at",
                                                        "type": "basic",
                                                        "name": "Th",
                                                        "props": {
                                                            "className": "px-6 py-3 text-left text-xs font-medium text-purple-600 dark:text-purple-300 uppercase tracking-wider"
                                                        },
                                                        "text": "$t:sirsoft-sample.admin.index.table.created_at"
                                                    },
                                                    {
                                                        "id": "th_actions",
                                                        "type": "basic",
                                                        "name": "Th",
                                                        "props": {
                                                            "className": "px-6 py-3 text-right text-xs font-medium text-purple-600 dark:text-purple-300 uppercase tracking-wider"
                                                        },
                                                        "text": "$t:sirsoft-sample.admin.index.table.actions"
                                                    }
                                                ]
                                            }
                                        ]
                                    },
                                    {
                                        "id": "table_body",
                                        "type": "basic",
                                        "name": "Tbody",
                                        "props": {
                                            "className": "divide-y divide-purple-100 dark:divide-purple-800"
                                        },
                                        "loop": {
                                            "source": "{{items.items}}",
                                            "item": "item",
                                            "template": {
                                                "id": "item_row_{{item.id}}",
                                                "type": "basic",
                                                "name": "Tr",
                                                "props": {
                                                    "className": "hover:bg-purple-50 dark:hover:bg-purple-900/30"
                                                },
                                                "children": [
                                                    {
                                                        "id": "td_id_{{item.id}}",
                                                        "type": "basic",
                                                        "name": "Td",
                                                        "props": {
                                                            "className": "text-primary px-6 py-4 whitespace-nowrap text-sm"
                                                        },
                                                        "text": "{{item.id}}"
                                                    },
                                                    {
                                                        "id": "td_name_{{item.id}}",
                                                        "type": "basic",
                                                        "name": "Td",
                                                        "props": {
                                                            "className": "px-6 py-4 whitespace-nowrap text-sm font-medium text-purple-900 dark:text-purple-100"
                                                        },
                                                        "text": "{{item.name}}"
                                                    },
                                                    {
                                                        "id": "td_status_{{item.id}}",
                                                        "type": "basic",
                                                        "name": "Td",
                                                        "props": {
                                                            "className": "px-6 py-4 whitespace-nowrap"
                                                        },
                                                        "children": [
                                                            {
                                                                "id": "status_badge_{{item.id}}",
                                                                "type": "basic",
                                                                "name": "Span",
                                                                "props": {
                                                                    "className": "px-2 py-1 text-xs font-medium rounded-full {{item.status === 'active' ? 'bg-purple-100 text-purple-800 dark:bg-purple-900 dark:text-purple-200' : 'bg-gray-100 text-gray-800 dark:bg-gray-700 dark:text-gray-200'}}"
                                                                },
                                                                "text": "{{item.status}}"
                                                            }
                                                        ]
                                                    },
                                                    {
                                                        "id": "td_created_{{item.id}}",
                                                        "type": "basic",
                                                        "name": "Td",
                                                        "props": {
                                                            "className": "px-6 py-4 whitespace-nowrap text-label-subtle"
                                                        },
                                                        "text": "{{item.created_at}}"
                                                    },
                                                    {
                                                        "id": "td_actions_{{item.id}}",
                                                        "type": "basic",
                                                        "name": "Td",
                                                        "props": {
                                                            "className": "px-6 py-4 whitespace-nowrap text-right text-sm font-medium"
                                                        },
                                                        "children": [
                                                            {
                                                                "id": "edit_link_{{item.id}}",
                                                                "type": "basic",
                                                                "name": "A",
                                                                "props": {
                                                                    "href": "/admin/sirsoft-sample/items/{{item.id}}/edit",
                                                                    "className": "text-purple-600 hover:text-purple-900 dark:text-purple-400 dark:hover:text-purple-300"
                                                                },
                                                                "text": "$t:sirsoft-sample.admin.index.table.edit"
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "pagination_container",
                        "type": "basic",
                        "name": "Div",
                        "props": {
                            "className": "mt-4 flex-between"
                        },
                        "children": [
                            {
                                "id": "pagination_info",
                                "type": "basic",
                                "name": "Span",
                                "props": {
                                    "className": "text-sm text-purple-700 dark:text-purple-300"
                                },
                                "text": "$t:sirsoft-sample.admin.index.pagination_info|total={{items.pagination.total}}"
                            }
                        ]
                    }
                ]
            }
        ]
    }
}
