"use client";

import Link from "next/link";

type Props = {
  id: number;
  title?: string;
  className?: string;
};

export default function EntryLink({ id, title, className }: Props) {
  const text = typeof title === "string" && title.length > 0 ? title : `#${id}`;
  return (
    <Link href={`/zxdb/entries/${id}`} className={className}>
      {text}
    </Link>
  );
}
