This commit is contained in:
2024-11-06 18:41:26 +05:00
parent 2148587b13
commit 75de39b5ba
2 changed files with 35 additions and 3 deletions

View File

@@ -61,13 +61,13 @@ class OnlinePaymentHistoryResource extends Resource
Text::make('Desc', 'description'), Text::make('Desc', 'description'),
Badge::make(__('Status'), 'paymentStatus') Badge::make(__('Status'), 'paymentStatus')
->map(OrderRepo::statusClasses()) ->map(OnlinePaymentRepo::statusClasses())
->addTypes([ ->addTypes([
'primary' => 'dark:bg-gray-900 bg-gray-600 text-white', 'primary' => 'dark:bg-gray-900 bg-gray-600 text-white',
]) ])
->labels(OrderRepo::statusValues()) ->labels(OnlinePaymentRepo::statusValues())
->withIcons() ->withIcons()
->icons(OrderRepo::statusIcons()) ->icons(OnlinePaymentRepo::statusIcons())
->sortable(), ->sortable(),
Text::make('username', 'username'), Text::make('username', 'username'),

View File

@@ -41,6 +41,38 @@ class OnlinePaymentRepo
]; ];
} }
/**
* Tailwind
*
* @return array<string, string>
*/
public static function statusClasses(): array
{
return [
null => '-',
self::PENDING => 'warning',
self::PAID => 'success',
self::FAILED => 'danger',
];
}
/**
* Status icons
*
* @return array<string, string>
*/
public static function statusIcons(): array
{
return [
null => '-',
'success' => 'check-circle',
'info' => 'information-circle',
'primary' => 'clipboard-list',
'danger' => 'ban',
'warning' => 'exclamation-circle',
];
}
/** /**
* Set price * Set price
*/ */