= $helper->a(
"https://kitsu.io/users/{$data['slug']}",
$data['name'], [
'title' => 'View profile on Kitsu'
])
?>
= $escape->html($data['about']) ?>
Favorites
= $component->tabs('user-favorites', $data['favorites'], static function ($items, $type) use ($component, $helper, $url) {
$rendered = [];
if ($type === 'characters')
{
uasort($items, fn ($a, $b) => $a['canonicalName'] <=> $b['canonicalName']);
}
else
{
uasort($items, fn ($a, $b) => Kitsu::filterTitles($a)[0] <=> Kitsu::filterTitles($b)[0]);
}
foreach ($items as $id => $item)
{
if ($type === 'characters')
{
$rendered[] = $component->character(
$item['canonicalName'],
$url->generate('character', ['slug', $item['slug']]),
$helper->picture("images/characters/{$item['id']}.webp")
);
}
else
{
$rendered[] = $component->media(
Kitsu::filterTitles($item),
$url->generate("{$type}.details", ['id' => $item['slug']]),
$helper->picture("images/{$type}/{$item['id']}.webp"),
);
}
}
return implode('', array_map('mb_trim', $rendered));
}, 'content full-width media-wrap') ?>