Skip to content
Tennantite
中文
Documentation

AnvilScreen

110×16 name input, item / material / result slots and level cost.

Full-screen previewPreview pages are excluded from search indexes
修理
1 级

Composition

These are the composable components; the Block only places them at vanilla coordinates.

Code

import { useState } from "react";

import { AnvilScreen } from "./index";

/**
 * AnvilScreen 预览用例(规格 §6.2)
*/
export function AnvilScreenDemo() {
  const [name, setName] = useState("铁剑");
  return (
    <AnvilScreen
      item={{ icon: "sword", tooltip: "铁剑" }}
      levelCost={1}
      material={{ count: 1, icon: "iron-ingot", tooltip: "铁锭" }}
      onNameChange={setName}
      result={{ icon: "sword", tooltip: "铁剑(已修复)" }}
      title="修理"
      value={name}
    />
  );
}