import React from 'react'
import { Head } from '@inertiajs/react'
import ModalInput from '@/Components/ModalInput'

export default function IndexSantri({ santri, fields, options, santris }) {
    return (
        <div className="text-red-900">
            <Head title="Daftar Santri" />
            <h1>Daftar Santri</h1>
            <ModalInput fields={fields} options={options} tableName="santris" />
            {santri ? santri.map((item, i) => {
                return (
                    <div key={i}>
                        <p>Nama: {item.nama}</p>
                        <p>Alamat: {item.alamat}</p>
                        <p>Status: {item.status_santri}</p>
                        <p>Role: {item.role_santri}</p>
                        <p>Jenis Kelamin: {item.jk}</p>
                        <p>Tanggal Lahir: {item.tanggal_lahir}</p>
                        <p>Foto: {item.foto}</p>
                        <hr />
                    </div>
                )
            }) : ""}
        </div>
    );
}