import { Link } from 'react-router'
import type { ObjectSummary } from '../api/types'

export function ObjectCard({ object, linkBase = '/objects' }: { object: ObjectSummary; linkBase?: string }) {
  return (
    <Link
      to={`${linkBase}/${object.id}`}
      className="flex flex-col gap-1 rounded-lg border border-slate-200 p-3 transition hover:border-slate-400 dark:border-slate-800 dark:hover:border-slate-600"
    >
      <span className="font-medium text-slate-900 dark:text-slate-100">{object.name}</span>
      <span className="text-sm text-slate-500 dark:text-slate-400">{object.inventory_number}</span>
    </Link>
  )
}
