import type { MouseEvent, ReactNode } from 'react';

/** HQ 主列表主展示列：下划线，点击进入编辑或详情 */
export function AdminPrimaryLink({
  children,
  onClick,
}: {
  children?: ReactNode;
  onClick: (e?: MouseEvent) => void;
}) {
  const empty = children == null || children === '';
  return (
    <button
      type="button"
      className="admin-primary-link"
      onClick={(e) => {
        e.preventDefault();
        e.stopPropagation();
        onClick(e);
      }}
    >
      {empty ? '—' : children}
    </button>
  );
}
