import { Head } from '@inertiajs/react'; import { Pencil, Plus, Quote, Trash2 } from 'lucide-react'; import type { ReactNode } from 'react'; import { ConfirmDelete, FormDialog, FormField, PageHeader, Textarea, } from '@/components/admin/form-controls'; import { Badge } from '@/components/ui/badge'; import { Button } from '@/components/ui/button'; import { Input } from '@/components/ui/input'; import { destroy, index, store, update } from '@/routes/admin/testimonials'; import type { Testimonial } from '@/types'; export default function TestimonialsIndex({ testimonials, }: { testimonials: Testimonial[]; }) { return ( <>
Tambah Testimoni } /> } /> {testimonials.length === 0 ? (
Belum ada testimoni. Bagian testimoni sedang disembunyikan di website.
) : (
{testimonials.map((testimonial) => (
{testimonial.is_published ? 'Tayang' : 'Draf'} } /> } />

“{testimonial.quote_id}”

{testimonial.role_id} ·{' '} {testimonial.organization_id}
))}
)}
); } function TestimonialDialog({ testimonial, nextOrder = 1, trigger, }: { testimonial?: Testimonial; nextOrder?: number; trigger: ReactNode; }) { const id = (field: string) => `testimonial-${testimonial?.id ?? 'new'}-${field}`; return ( {(errors) => ( <>