import { useState } from 'react'; import { Head, Link, router } from '@inertiajs/react'; import AppLayout from '@/Layouts/AppLayout.jsx'; import { DateTime } from "luxon"; import { BreadcrumbItem, BreadcrumbPage, BreadcrumbSeparator } from "@/components/ui/breadcrumb"; import { Table, TableBody, TableCaption, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table"; import { Button } from "@/components/ui/button.jsx"; export default function Histories({ auth, histories }) { const deleteButtonOnClickHandler = () => { router.visit(route('comics.patchHistories'), { data: (ids.length > 0) ? { ids: ids } : { ids: 'all' }, method: "PATCH", only: ['histories'], onSuccess: data => { toast({ title: "All set", description: `The histories has been deleted.`, }); } }); } const removeDuplicatedButtonOnClickHandler = () => { router.visit(route('comics.destroyHistories'), { data: (ids.length > 0) ? { ids: ids } : { ids: 'all' }, method: "DELETE", only: ['histories'], onSuccess: data => { toast({ title: "All set", description: `The duplicated records has been deleted.`, }); } }); } return ( Histories }> Histories
Comic Chapter Read at { histories.map((comic, i) => comic.histories.map((record, j) => ( { (j === 0) && { comic.comic.comic_name } } { record.chapter_name } { record.read_at } ) ) ) }
); }