feat(ui): improve review actions, table headers, and detection previews
This commit is contained in:
@@ -176,13 +176,9 @@ export function IssueReviewAction({
|
|||||||
<div className="grid grid-cols-2 gap-2">
|
<div className="grid grid-cols-2 gap-2">
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="default"
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
onClick={() => void submitDecision('approve')}
|
onClick={() => void submitDecision('approve')}
|
||||||
className={cn(
|
|
||||||
decision === 'approve' &&
|
|
||||||
'border-emerald-500 bg-emerald-500/10 text-emerald-700 hover:bg-emerald-500/15 dark:text-emerald-300',
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
{isPending && decision === 'approve' ? (
|
{isPending && decision === 'approve' ? (
|
||||||
<Loader2 className="animate-spin" />
|
<Loader2 className="animate-spin" />
|
||||||
@@ -193,13 +189,9 @@ export function IssueReviewAction({
|
|||||||
</Button>
|
</Button>
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
variant="outline"
|
variant="destructive"
|
||||||
disabled={isPending}
|
disabled={isPending}
|
||||||
onClick={() => void submitDecision('reject')}
|
onClick={() => void submitDecision('reject')}
|
||||||
className={cn(
|
|
||||||
decision === 'reject' &&
|
|
||||||
'border-destructive bg-destructive/10 text-destructive hover:bg-destructive/15',
|
|
||||||
)}
|
|
||||||
>
|
>
|
||||||
{isPending && decision === 'reject' ? (
|
{isPending && decision === 'reject' ? (
|
||||||
<Loader2 className="animate-spin" />
|
<Loader2 className="animate-spin" />
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ import { getPinnedColumnStyles } from './columnStyles';
|
|||||||
|
|
||||||
const TableHeader = <TData, _>({ table }: { table: Table<TData> }) => {
|
const TableHeader = <TData, _>({ table }: { table: Table<TData> }) => {
|
||||||
return (
|
return (
|
||||||
<ShadTableHeader className="sticky top-0 z-20 bg-muted/70 backdrop-blur supports-backdrop-filter:bg-muted/60">
|
<ShadTableHeader className="sticky top-0 z-20 bg-muted">
|
||||||
{table.getHeaderGroups().map((headerGroup) => (
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
<TableRow key={headerGroup.id}>
|
<TableRow key={headerGroup.id}>
|
||||||
{headerGroup.headers.map((header) => {
|
{headerGroup.headers.map((header) => {
|
||||||
@@ -39,7 +39,7 @@ const TableHeader = <TData, _>({ table }: { table: Table<TData> }) => {
|
|||||||
canSort ? header.column.getToggleSortingHandler() : undefined
|
canSort ? header.column.getToggleSortingHandler() : undefined
|
||||||
}
|
}
|
||||||
className={cn(
|
className={cn(
|
||||||
'h-11 max-w-0 overflow-hidden border-b border-border bg-muted/70 px-4 text-sm font-semibold text-foreground transition-colors',
|
'h-11 max-w-0 overflow-hidden border-b border-border bg-muted px-4 text-sm font-semibold text-foreground transition-colors',
|
||||||
canSort && 'cursor-pointer select-none hover:bg-muted',
|
canSort && 'cursor-pointer select-none hover:bg-muted',
|
||||||
sortDirection && 'bg-muted',
|
sortDirection && 'bg-muted',
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -41,11 +41,7 @@ export default function AnnotatedDetectionImage({
|
|||||||
]
|
]
|
||||||
: [];
|
: [];
|
||||||
|
|
||||||
const aspectRatio =
|
const aspectRatio = aspectRatioOverride ?? '16 / 9';
|
||||||
aspectRatioOverride ??
|
|
||||||
(videoWidth > 0 && videoHeight > 0
|
|
||||||
? `${videoWidth} / ${videoHeight}`
|
|
||||||
: '16 / 9');
|
|
||||||
|
|
||||||
const annotatedMedia = objectUrl ? (
|
const annotatedMedia = objectUrl ? (
|
||||||
<>
|
<>
|
||||||
@@ -75,14 +71,7 @@ export default function AnnotatedDetectionImage({
|
|||||||
className="group relative flex w-full cursor-zoom-in items-center justify-center overflow-hidden rounded-lg border bg-black focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
className="group relative flex w-full cursor-zoom-in items-center justify-center overflow-hidden rounded-lg border bg-black focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2"
|
||||||
style={{ aspectRatio }}
|
style={{ aspectRatio }}
|
||||||
>
|
>
|
||||||
<Image
|
{annotatedMedia}
|
||||||
src={objectUrl}
|
|
||||||
alt={`${detection.detection.display_name} detection`}
|
|
||||||
fill
|
|
||||||
unoptimized
|
|
||||||
sizes="(min-width: 1280px) 18rem, (min-width: 640px) 50vw, 100vw"
|
|
||||||
className="object-contain"
|
|
||||||
/>
|
|
||||||
<span className="pointer-events-none absolute inset-x-0 bottom-0 z-[3] bg-gradient-to-t from-black/70 to-transparent px-3 pb-2 pt-8 text-center text-xs font-medium text-white opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100">
|
<span className="pointer-events-none absolute inset-x-0 bottom-0 z-[3] bg-gradient-to-t from-black/70 to-transparent px-3 pb-2 pt-8 text-center text-xs font-medium text-white opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100">
|
||||||
Click to view annotated image
|
Click to view annotated image
|
||||||
</span>
|
</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user