#!/usr/bin/env python
# -*- coding: UTF-8 -*-
# Copyright (c) Huawei Technologies Co., Ltd. 2025-2025. All rights reserved.
from typing import List, Any

from openjiuwen_studio.core.common import dsl
from openjiuwen_studio.schemas.node import Node
from openjiuwen_studio.core.common.dsl import ComponentType


def empty_convert(node: Node) -> dsl.Component:
    try:
        data = node.data
        return dsl.Component(
            id=node.id,
            type=ComponentType.COMPONENT_TYPE_EMPTY,
            type_version="1.0.0",
            description="",
            name=data.title
        )
    except Exception as e:
        raise RuntimeError(f"Failed to convert empty node: {str(e)}") from e
