How to show simple array on view page?

Hey guys,
in my model I have simple array attribute answers in this format:
[
  "Gender" => "male",
  "Age" => "24",
  ...
]


I want to display it in my resource view page:
Infolists\Components\Section::make(__('Answers'))
    ->icon('heroicon-o-question-mark-circle')
    ->schema([
        Infolists\Components\RepeatableEntry::make('answers')
            ->hiddenLabel()
            ->schema([
                Infolists\Components\TextEntry::make('0')
                    ->label(__('Question')),

                Infolists\Components\TextEntry::make('1')
                    ->label(__('Answer')),
            ]),
    ])
    ->collapsible(),

Can you help me, how to do it correctly?
Solution
custom view I think

<!-- custom.blade.php -->
<div>
    @foreach ($getState() as $key => $value)
        <div class="flex gap-2">
            <div>{{ $key }}</div>
            <div>{{ $value }}</div>
        </div>
    @endforeach
</div>


ViewEntry::make('answers')
    ->view('custom')
Was this page helpful?