mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-20 13:32:00 +00:00
refactor(FE-316, 438): Move uniformity types into shared types file
This commit is contained in:
@@ -9,7 +9,6 @@ import DrawerHeader from '@/components/helper/drawer/DrawerHeader';
|
|||||||
import Table from '@/components/Table';
|
import Table from '@/components/Table';
|
||||||
import Badge from '@/components/Badge';
|
import Badge from '@/components/Badge';
|
||||||
import Tooltip from '@/components/Tooltip';
|
import Tooltip from '@/components/Tooltip';
|
||||||
import { type OptionType } from '@/components/input/SelectInput';
|
|
||||||
import RequirePermission from '@/components/helper/RequirePermission';
|
import RequirePermission from '@/components/helper/RequirePermission';
|
||||||
import { UniformityDetail as UniformityDetailType } from '@/types/api/uniformity/uniformity';
|
import { UniformityDetail as UniformityDetailType } from '@/types/api/uniformity/uniformity';
|
||||||
import { formatDate } from '@/lib/helper';
|
import { formatDate } from '@/lib/helper';
|
||||||
@@ -20,10 +19,7 @@ import {
|
|||||||
getStatusIndicatorColor,
|
getStatusIndicatorColor,
|
||||||
getStatusText,
|
getStatusText,
|
||||||
} from '@/components/pages/uniformity/uniformity-utils';
|
} from '@/components/pages/uniformity/uniformity-utils';
|
||||||
|
import { DetailOptionType } from '@/types/api/uniformity/uniformity';
|
||||||
export type DetailOptionType = OptionType & {
|
|
||||||
id: string;
|
|
||||||
};
|
|
||||||
|
|
||||||
interface UniformityDetailProps {
|
interface UniformityDetailProps {
|
||||||
initialValues: UniformityDetailType;
|
initialValues: UniformityDetailType;
|
||||||
|
|||||||
@@ -14,19 +14,13 @@ import {
|
|||||||
import Table from '@/components/Table';
|
import Table from '@/components/Table';
|
||||||
import Badge from '@/components/Badge';
|
import Badge from '@/components/Badge';
|
||||||
import { formatNumber } from '@/lib/helper';
|
import { formatNumber } from '@/lib/helper';
|
||||||
import { DetailOptionType } from '@/components/pages/uniformity/detail/UniformityDetail';
|
import { DetailOptionType } from '@/types/api/uniformity/uniformity';
|
||||||
import {
|
import {
|
||||||
getWeightStatusColor,
|
getWeightStatusColor,
|
||||||
getWeightStatusIndicatorColor,
|
getWeightStatusIndicatorColor,
|
||||||
getWeightStatusText,
|
getWeightStatusText,
|
||||||
} from '@/components/pages/uniformity/uniformity-utils';
|
} from '@/components/pages/uniformity/uniformity-utils';
|
||||||
|
import { BodyWeightData } from '@/types/api/uniformity/uniformity';
|
||||||
type BodyWeightData = {
|
|
||||||
id: string;
|
|
||||||
number: number;
|
|
||||||
weight: number;
|
|
||||||
status?: 'ideal' | 'outside';
|
|
||||||
};
|
|
||||||
|
|
||||||
interface UniformityDetailsPreviewProps {
|
interface UniformityDetailsPreviewProps {
|
||||||
info_umum: UniformityInfoUmum;
|
info_umum: UniformityInfoUmum;
|
||||||
|
|||||||
@@ -10,12 +10,7 @@ import { useUiStore } from '@/stores/ui/ui.store';
|
|||||||
import { useUniformityStore } from '@/stores/uniformity/uniformity.store';
|
import { useUniformityStore } from '@/stores/uniformity/uniformity.store';
|
||||||
import RequirePermission from '@/components/helper/RequirePermission';
|
import RequirePermission from '@/components/helper/RequirePermission';
|
||||||
import Table from '@/components/Table';
|
import Table from '@/components/Table';
|
||||||
|
import { BodyWeightData } from '@/types/api/uniformity/uniformity';
|
||||||
type BodyWeightData = {
|
|
||||||
id: string;
|
|
||||||
number: number;
|
|
||||||
weight: number;
|
|
||||||
};
|
|
||||||
|
|
||||||
const UniformityPreviewForm = () => {
|
const UniformityPreviewForm = () => {
|
||||||
const setExpandedDrawerOpen = useUiStore((s) => s.setExpandedDrawerOpen);
|
const setExpandedDrawerOpen = useUiStore((s) => s.setExpandedDrawerOpen);
|
||||||
|
|||||||
@@ -21,14 +21,8 @@ import {
|
|||||||
getWeightStatusIndicatorColor,
|
getWeightStatusIndicatorColor,
|
||||||
getWeightStatusText,
|
getWeightStatusText,
|
||||||
} from '@/components/pages/uniformity/uniformity-utils';
|
} from '@/components/pages/uniformity/uniformity-utils';
|
||||||
import { DetailOptionType } from '@/components/pages/uniformity/detail/UniformityDetail';
|
import { DetailOptionType } from '@/types/api/uniformity/uniformity';
|
||||||
|
import { BodyWeightData } from '@/types/api/uniformity/uniformity';
|
||||||
type BodyWeightData = {
|
|
||||||
id: string;
|
|
||||||
number: number;
|
|
||||||
weight: number;
|
|
||||||
status?: 'ideal' | 'outside';
|
|
||||||
};
|
|
||||||
|
|
||||||
const UniformityResultForm = () => {
|
const UniformityResultForm = () => {
|
||||||
const router = useRouter();
|
const router = useRouter();
|
||||||
|
|||||||
+12
@@ -87,3 +87,15 @@ export type VerifyUniformityPayload = {
|
|||||||
file: File;
|
file: File;
|
||||||
week: number;
|
week: number;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// ==================== OTHER TYPES ====================
|
||||||
|
export type BodyWeightData = {
|
||||||
|
id: string;
|
||||||
|
number: number;
|
||||||
|
weight: number;
|
||||||
|
status?: 'ideal' | 'outside';
|
||||||
|
};
|
||||||
|
|
||||||
|
export type DetailOptionType = OptionType & {
|
||||||
|
id: string;
|
||||||
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user