<?php

namespace App\Filament\Support;

use Filament\Support\Enums\FontFamily;
use Filament\Tables\Columns\TextColumn;

/**
 * Document-number chips for table listings: the grey, mono, copyable pill that
 * separates "what this row IS" (a number) from "what state it is in" (a status
 * badge). A badge should mean state and nothing else — every order_number,
 * invoice_number, grn_number, cn_number, po_number, sku and serial_number in
 * the app renders through here, so the two never look alike again and a cashier
 * can copy a number without hunting for it.
 */
class Chip
{
    public static function documentNumber(string $name, ?string $label = null): TextColumn
    {
        return TextColumn::make($name)
            ->label($label)
            ->badge()
            ->color('gray')
            ->fontFamily(FontFamily::Mono)
            ->copyable()
            ->copyMessage('Number copied');
    }
}
