Files
RomhackPlaza/app/View/Components/EntryCard.php

45 lines
879 B
PHP
Raw Permalink Normal View History

<?php
namespace App\View\Components;
use App\Models\Entry;
use Closure;
use Illuminate\Contracts\View\View;
use Illuminate\View\Component;
class EntryCard extends Component
{
/**
* Acronym for entry badge.
* TODO: Add in common.css other colors.
*/
public const array ENTRY_TYPES_BADGE = [
'translations' => "Trans",
'romhacks' => 'Hack',
'homebrew' => 'HBrew',
'utilities' => 'Util',
'documents' => 'Doc',
'lua-scripts' => 'Lua',
'tutorials' => 'Tuto'
];
/**
* Create a new component instance.
*/
public function __construct(
public Entry $entry,
)
{
//
}
/**
* Get the view / contents that represent the component.
*/
public function render(): View|Closure|string
{
return view('components.entry-card');
}
}