このコミットが含まれているのは:
@@ -12,6 +12,7 @@ import type { PostImportRow } from '@/lib/postImportSession'
|
||||
|
||||
type Props = {
|
||||
row: PostImportRow
|
||||
displayNumber?: number
|
||||
onEdit?: () => void
|
||||
onRetry?: () => void
|
||||
onToggleSkip?: (checked: boolean) => void
|
||||
@@ -35,6 +36,7 @@ const summaryDate = (row: PostImportRow): string =>
|
||||
|
||||
const PostImportRowSummary: FC<Props> = (
|
||||
{ row,
|
||||
displayNumber,
|
||||
onEdit,
|
||||
onRetry,
|
||||
onToggleSkip,
|
||||
@@ -47,9 +49,11 @@ const PostImportRowSummary: FC<Props> = (
|
||||
) => {
|
||||
const warning = summaryWarning (row)
|
||||
const displayStatus = displayPostImportStatus (row)
|
||||
const editAllowed = onEdit != null && canEditReviewRow (row)
|
||||
const editVisible = onEdit != null
|
||||
const editAllowed = editVisible && canEditReviewRow (row)
|
||||
const retryAllowed = onRetry != null && canRetryResultRow (row)
|
||||
const skipChecked = row.skipReason === 'manual'
|
||||
const rowNumber = displayNumber ?? row.sourceRow
|
||||
const skipControl = showSkipToggle
|
||||
? (
|
||||
<label className="flex items-center gap-2 text-sm">
|
||||
@@ -70,7 +74,7 @@ const PostImportRowSummary: FC<Props> = (
|
||||
'md:grid-cols-[4rem_5rem_minmax(0,1fr)_auto_auto]',
|
||||
'transition-shadow hover:shadow-sm')}>
|
||||
<div className="space-y-1">
|
||||
<div className="text-sm font-medium">#{row.sourceRow}</div>
|
||||
<div className="text-sm font-medium">#{rowNumber}</div>
|
||||
</div>
|
||||
<PostImportThumbnailPreview
|
||||
url={String (row.attributes.thumbnailBase ?? '')}
|
||||
@@ -100,12 +104,12 @@ const PostImportRowSummary: FC<Props> = (
|
||||
<div className="flex justify-end">
|
||||
<div className="flex items-center gap-2">
|
||||
{skipControl}
|
||||
{showActions && editAllowed && (
|
||||
{showActions && editVisible && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={onEdit}
|
||||
disabled={editDisabled === true}>
|
||||
disabled={editDisabled === true || !(editAllowed)}>
|
||||
編輯
|
||||
</Button>)}
|
||||
{showActions && retryAllowed && (
|
||||
@@ -124,6 +128,7 @@ const PostImportRowSummary: FC<Props> = (
|
||||
className={cn (
|
||||
'space-y-3 rounded-lg border p-4 md:hidden',
|
||||
'transition-shadow hover:shadow-sm')}>
|
||||
<div className="text-sm font-medium">#{rowNumber}</div>
|
||||
<div className="flex items-start gap-3">
|
||||
<PostImportThumbnailPreview
|
||||
url={String (row.attributes.thumbnailBase ?? '')}
|
||||
@@ -152,14 +157,14 @@ const PostImportRowSummary: FC<Props> = (
|
||||
{skipControl}
|
||||
</div>
|
||||
</div>
|
||||
{showActions && (editAllowed || retryAllowed) && (
|
||||
{showActions && (editVisible || retryAllowed) && (
|
||||
<div className="flex flex-col gap-2 sm:flex-row">
|
||||
{editAllowed && (
|
||||
{editVisible && (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={onEdit}
|
||||
disabled={editDisabled === true}>
|
||||
disabled={editDisabled === true || !(editAllowed)}>
|
||||
編輯
|
||||
</Button>)}
|
||||
{retryAllowed && (
|
||||
|
||||
新しい課題から参照
ユーザをブロックする