"use client";

import Link from "next/link";

type MT = { id: number; name: string };

export default function MachineTypeList({ items }: { items: MT[] }) {
  return (
    <div>
      <h1>Machine Types</h1>
      <ul className="list-group">
        {items.map((m) => (
          <li key={m.id} className="list-group-item d-flex justify-content-between align-items-center">
            <Link href={`/zxdb/machinetypes/${m.id}`}>{m.name}</Link>
            <span className="badge text-bg-light">#{m.id}</span>
          </li>
        ))}
      </ul>
    </div>
  );
}
