mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-30 15:48:11 +00:00
changes
This commit is contained in:
@@ -4,3 +4,17 @@ import { twMerge } from "tailwind-merge";
|
|||||||
export function cn(...inputs: ClassValue[]) {
|
export function cn(...inputs: ClassValue[]) {
|
||||||
return twMerge(clsx(inputs));
|
return twMerge(clsx(inputs));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Human label for a trade direction — DOMESTIC reads "Intercity" everywhere. */
|
||||||
|
export function directionLabel(direction?: string | null): string {
|
||||||
|
switch (direction) {
|
||||||
|
case "IMPORT":
|
||||||
|
return "Import";
|
||||||
|
case "EXPORT":
|
||||||
|
return "Export";
|
||||||
|
case "DOMESTIC":
|
||||||
|
return "Intercity";
|
||||||
|
default:
|
||||||
|
return direction || "—";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { directionLabel } from "@/lib/utils";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Box,
|
Box,
|
||||||
@@ -199,7 +200,7 @@ export default function ClearanceDocumentsPage() {
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
className="h-5 border-border/50 bg-background/50 px-1.5 text-[10px] font-medium uppercase backdrop-blur-sm"
|
className="h-5 border-border/50 bg-background/50 px-1.5 text-[10px] font-medium uppercase backdrop-blur-sm"
|
||||||
>
|
>
|
||||||
{c.tradeDirection}
|
{directionLabel(c.tradeDirection)}
|
||||||
</Badge>
|
</Badge>
|
||||||
<Badge
|
<Badge
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { directionLabel } from "@/lib/utils";
|
||||||
import { useMemo } from "react";
|
import { useMemo } from "react";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { useLocation, useParams } from "react-router-dom";
|
import { useLocation, useParams } from "react-router-dom";
|
||||||
@@ -468,7 +469,7 @@ function ClearanceHero({
|
|||||||
color={direction === "IMPORT" ? "edr-green" : "gray"}
|
color={direction === "IMPORT" ? "edr-green" : "gray"}
|
||||||
radius="sm"
|
radius="sm"
|
||||||
>
|
>
|
||||||
{direction}
|
{directionLabel(direction)}
|
||||||
</Badge>
|
</Badge>
|
||||||
{customs ? (
|
{customs ? (
|
||||||
<Badge
|
<Badge
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { directionLabel } from "@/lib/utils";
|
||||||
import {
|
import {
|
||||||
Fragment,
|
Fragment,
|
||||||
useCallback,
|
useCallback,
|
||||||
@@ -180,7 +181,7 @@ function CustomsBadge({ customs }: { customs: boolean }) {
|
|||||||
function DirectionIcon({ direction }: { direction: string }) {
|
function DirectionIcon({ direction }: { direction: string }) {
|
||||||
const isImport = direction === "IMPORT";
|
const isImport = direction === "IMPORT";
|
||||||
const Icon = isImport ? Truck : ShipWheel;
|
const Icon = isImport ? Truck : ShipWheel;
|
||||||
const label = isImport ? "Import" : direction === "EXPORT" ? "Export" : "—";
|
const label = directionLabel(direction);
|
||||||
return (
|
return (
|
||||||
<Tooltip label={label} withArrow>
|
<Tooltip label={label} withArrow>
|
||||||
<ThemeIcon
|
<ThemeIcon
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { directionLabel } from "@/lib/utils";
|
||||||
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
import { useNavigate, useParams, useSearchParams } from "react-router-dom";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import {
|
import {
|
||||||
@@ -597,7 +598,7 @@ export default function ContractRequestDetailPage() {
|
|||||||
<SectionCard icon={Package} title="Cargo scope">
|
<SectionCard icon={Package} title="Cargo scope">
|
||||||
<Group gap="sm" mb="md">
|
<Group gap="sm" mb="md">
|
||||||
<Badge variant="light" color="gray" radius="sm" tt="uppercase">
|
<Badge variant="light" color="gray" radius="sm" tt="uppercase">
|
||||||
{contract.tradeDirection}
|
{directionLabel(contract.tradeDirection)}
|
||||||
</Badge>
|
</Badge>
|
||||||
<Badge variant="light" color="gray" radius="sm" tt="uppercase">
|
<Badge variant="light" color="gray" radius="sm" tt="uppercase">
|
||||||
{contract.freightType}
|
{contract.freightType}
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { directionLabel } from "@/lib/utils";
|
||||||
import {
|
import {
|
||||||
ActionIcon,
|
ActionIcon,
|
||||||
Box,
|
Box,
|
||||||
@@ -299,7 +300,7 @@ export default function ContractRequestsPage() {
|
|||||||
variant="outline"
|
variant="outline"
|
||||||
className="h-5 border-border/50 bg-background/50 px-1.5 text-[10px] font-medium uppercase backdrop-blur-sm"
|
className="h-5 border-border/50 bg-background/50 px-1.5 text-[10px] font-medium uppercase backdrop-blur-sm"
|
||||||
>
|
>
|
||||||
{c.tradeDirection}
|
{directionLabel(c.tradeDirection)}
|
||||||
</Badge>
|
</Badge>
|
||||||
<Badge
|
<Badge
|
||||||
variant="secondary"
|
variant="secondary"
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { directionLabel } from "@/lib/utils";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { useQuery } from "@tanstack/react-query";
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import { useParams } from "react-router-dom";
|
import { useParams } from "react-router-dom";
|
||||||
@@ -173,7 +174,7 @@ export default function GlClearanceDetailPage() {
|
|||||||
]}
|
]}
|
||||||
meta={
|
meta={
|
||||||
<Badge variant="light" color={isImport ? "edr-green" : "gray"} radius="sm">
|
<Badge variant="light" color={isImport ? "edr-green" : "gray"} radius="sm">
|
||||||
{data.tradeDirection}
|
{directionLabel(data.tradeDirection)}
|
||||||
</Badge>
|
</Badge>
|
||||||
}
|
}
|
||||||
action={
|
action={
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { directionLabel } from "@/lib/utils";
|
||||||
import { useCallback, useMemo, useState } from "react";
|
import { useCallback, useMemo, useState } from "react";
|
||||||
import { useNavigate } from "react-router-dom";
|
import { useNavigate } from "react-router-dom";
|
||||||
import {
|
import {
|
||||||
@@ -249,7 +250,7 @@ function toContractRow(c: Freight.IContract): ContractRow {
|
|||||||
function DirectionIcon({ direction }: { direction: string }) {
|
function DirectionIcon({ direction }: { direction: string }) {
|
||||||
const isImport = direction === "IMPORT";
|
const isImport = direction === "IMPORT";
|
||||||
const Icon = isImport ? Truck : ShipWheel;
|
const Icon = isImport ? Truck : ShipWheel;
|
||||||
const label = isImport ? "Import" : direction === "EXPORT" ? "Export" : "—";
|
const label = directionLabel(direction);
|
||||||
return (
|
return (
|
||||||
<Tooltip label={label} withArrow>
|
<Tooltip label={label} withArrow>
|
||||||
<ThemeIcon
|
<ThemeIcon
|
||||||
|
|||||||
Reference in New Issue
Block a user