import { Card, Text, Stack } from "@mantine/core";

export default function NodeMetaCard({ node }) {
  const meta = node.meta_data || {};

  return (
    <Card shadow="xs" radius="md" withBorder>
      <Text fw={600} mb="sm">元数据信息</Text>
      <Stack spacing="xs">
        <Text size="sm">主机名: <Text span c="dimmed">{meta.hostname}</Text></Text>
        <Text size="sm">IP: <Text span c="dimmed">{meta.ip}</Text></Text>
        <Text size="sm">环境: <Text span c="dimmed">{meta.env}</Text></Text>
        <Text size="sm">用户: <Text span c="dimmed">{meta.user}</Text></Text>
        <Text size="sm">实例: <Text span c="dimmed">{meta.instance}</Text></Text>
        <Text size="sm">CPU 数量: <Text span c="dimmed">{meta.cpu_number}</Text></Text>
        <Text size="sm">内存: <Text span c="dimmed">{(meta.memory_in_bytes / 1024 / 1024).toFixed(2)} MB</Text></Text>
        <Text size="sm">GPU 数量: <Text span c="dimmed">{meta.gpu_number}</Text></Text>
      </Stack>
    </Card>
  );
}
