mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
refactor(FE): Remove unused imports and redundant code
This commit is contained in:
+14
-17
@@ -17,7 +17,7 @@ import {
|
||||
DialogFooter,
|
||||
} from '@/figma-make/components/base/dialog';
|
||||
import { toast } from 'sonner';
|
||||
import { notFound, useRouter, useSearchParams } from 'next/navigation';
|
||||
import { useRouter, useSearchParams } from 'next/navigation';
|
||||
import { DailyChecklistApi } from '@/services/api/daily-checklist/daily-checklist';
|
||||
import { isResponseError } from '@/lib/api-helper';
|
||||
import Link from 'next/link';
|
||||
@@ -90,16 +90,16 @@ interface ChecklistData {
|
||||
};
|
||||
}
|
||||
|
||||
interface AssignmentQueryResult {
|
||||
task_id: number;
|
||||
employee_id: string;
|
||||
checked: boolean;
|
||||
note: string | null;
|
||||
employees: {
|
||||
id: number;
|
||||
name: string;
|
||||
} | null;
|
||||
}
|
||||
// interface AssignmentQueryResult {
|
||||
// task_id: number;
|
||||
// employee_id: string;
|
||||
// checked: boolean;
|
||||
// note: string | null;
|
||||
// employees: {
|
||||
// id: number;
|
||||
// name: string;
|
||||
// } | null;
|
||||
// }
|
||||
|
||||
const CATEGORY_LABELS: { [key: string]: string } = {
|
||||
pullet_open: 'Pullet Open',
|
||||
@@ -124,7 +124,7 @@ export function DetailDailyChecklistContent() {
|
||||
|
||||
const [loading, setLoading] = useState(true);
|
||||
const [header, setHeader] = useState<ChecklistHeader | null>(null);
|
||||
const [detailRows, setDetailRows] = useState<ChecklistDetailRow[]>([]);
|
||||
const [, setDetailRows] = useState<ChecklistDetailRow[]>([]);
|
||||
const [phaseGroups, setPhaseGroups] = useState<PhaseGroup[]>([]);
|
||||
const [employees, setEmployees] = useState<{ id: string; name: string }[]>(
|
||||
[]
|
||||
@@ -381,7 +381,7 @@ export function DetailDailyChecklistContent() {
|
||||
// Convert to array and group by time_type
|
||||
const grouped: PhaseGroup[] = [];
|
||||
|
||||
phaseMap.forEach((phaseData, phaseId) => {
|
||||
phaseMap.forEach((phaseData) => {
|
||||
const timeGroups: {
|
||||
[timeType: string]: {
|
||||
activities: {
|
||||
@@ -570,9 +570,6 @@ export function DetailDailyChecklistContent() {
|
||||
return null;
|
||||
}
|
||||
|
||||
const isReadOnly =
|
||||
header.status === 'APPROVED' || header.status === 'REJECTED';
|
||||
|
||||
return (
|
||||
<div className='min-h-screen'>
|
||||
<div className='p-6'>
|
||||
@@ -680,7 +677,7 @@ export function DetailDailyChecklistContent() {
|
||||
{header.status === 'REJECTED' && header.reject_reason && (
|
||||
<div className='mt-6 pt-6 border-t border-gray-200'>
|
||||
<div className='flex items-start gap-3 p-4 bg-red-50 border border-red-200 rounded-lg'>
|
||||
<AlertCircle className='w-5 h-5 text-red-600 mt-0.5 flex-shrink-0' />
|
||||
<AlertCircle className='w-5 h-5 text-red-600 mt-0.5 shrink-0' />
|
||||
<div>
|
||||
<Label className='text-sm font-medium text-red-900'>
|
||||
Alasan Reject
|
||||
|
||||
Reference in New Issue
Block a user