refactor(frontend): clean up code by consolidating multi-line JSX into single lines where feasible
- Refactored JSX elements to improve readability by collapsing multi-line props and attributes into single lines if their length permits. - Improved consistency in component imports by grouping and consolidating them. - No functional changes, purely restructuring for clarity and maintainability.
This commit is contained in:
@@ -10,13 +10,7 @@
|
||||
|
||||
import { use } from 'react';
|
||||
import Link from 'next/link';
|
||||
import {
|
||||
ArrowLeft,
|
||||
Calendar,
|
||||
Clock,
|
||||
ExternalLink,
|
||||
Edit,
|
||||
} from 'lucide-react';
|
||||
import { ArrowLeft, Calendar, Clock, ExternalLink, Edit } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Card, CardHeader, CardTitle, CardContent } from '@/components/ui/card';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
@@ -65,10 +59,7 @@ export default function IssueDetailPage({ params }: IssueDetailPageProps) {
|
||||
<Link href={`/${locale}/projects/${projectId}/issues`}>
|
||||
<Button variant="outline">Back to Issues</Button>
|
||||
</Link>
|
||||
<Button
|
||||
variant="outline"
|
||||
onClick={() => window.location.reload()}
|
||||
>
|
||||
<Button variant="outline" onClick={() => window.location.reload()}>
|
||||
Retry
|
||||
</Button>
|
||||
</div>
|
||||
@@ -171,9 +162,7 @@ export default function IssueDetailPage({ params }: IssueDetailPageProps) {
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="prose prose-sm max-w-none dark:prose-invert">
|
||||
<pre className="whitespace-pre-wrap font-sans text-sm">
|
||||
{issue.description}
|
||||
</pre>
|
||||
<pre className="whitespace-pre-wrap font-sans text-sm">{issue.description}</pre>
|
||||
</div>
|
||||
</CardContent>
|
||||
</Card>
|
||||
|
||||
@@ -14,12 +14,7 @@ import { useRouter } from 'next/navigation';
|
||||
import { Plus, Upload } from 'lucide-react';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { Skeleton } from '@/components/ui/skeleton';
|
||||
import {
|
||||
IssueFilters,
|
||||
IssueTable,
|
||||
BulkActions,
|
||||
useIssues,
|
||||
} from '@/features/issues';
|
||||
import { IssueFilters, IssueTable, BulkActions, useIssues } from '@/features/issues';
|
||||
import type { IssueFiltersType, IssueSort } from '@/features/issues';
|
||||
|
||||
interface ProjectIssuesPageProps {
|
||||
@@ -95,11 +90,7 @@ export default function ProjectIssuesPage({ params }: ProjectIssuesPageProps) {
|
||||
<p className="mt-2 text-sm text-muted-foreground">
|
||||
Failed to load issues. Please try again later.
|
||||
</p>
|
||||
<Button
|
||||
variant="outline"
|
||||
className="mt-4"
|
||||
onClick={() => window.location.reload()}
|
||||
>
|
||||
<Button variant="outline" className="mt-4" onClick={() => window.location.reload()}>
|
||||
Retry
|
||||
</Button>
|
||||
</div>
|
||||
@@ -169,26 +160,15 @@ export default function ProjectIssuesPage({ params }: ProjectIssuesPageProps) {
|
||||
<div className="flex items-center justify-between text-sm text-muted-foreground">
|
||||
<span>
|
||||
Showing {(data.pagination.page - 1) * data.pagination.page_size + 1} to{' '}
|
||||
{Math.min(
|
||||
data.pagination.page * data.pagination.page_size,
|
||||
data.pagination.total
|
||||
)}{' '}
|
||||
of {data.pagination.total} issues
|
||||
{Math.min(data.pagination.page * data.pagination.page_size, data.pagination.total)} of{' '}
|
||||
{data.pagination.total} issues
|
||||
</span>
|
||||
{data.pagination.total_pages > 1 && (
|
||||
<div className="flex gap-2">
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={!data.pagination.has_prev}
|
||||
>
|
||||
<Button variant="outline" size="sm" disabled={!data.pagination.has_prev}>
|
||||
Previous
|
||||
</Button>
|
||||
<Button
|
||||
variant="outline"
|
||||
size="sm"
|
||||
disabled={!data.pagination.has_next}
|
||||
>
|
||||
<Button variant="outline" size="sm" disabled={!data.pagination.has_next}>
|
||||
Next
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user