gitscope
← marzneshin / v0.1.1 / app/dashboard/src/constants/Settings.tsx
https://dev.kronoz.win/r/marzneshin.git
app/dashboard/src/constants/Settings.tsx · TypeScript
Blame Raw
  1import { chakra, ChakraComponent } from '@chakra-ui/react';
  2import {
  3  ClockIcon,
  4  ExclamationCircleIcon,
  5  NoSymbolIcon,
  6  WifiIcon,
  7} from '@heroicons/react/24/outline';
  8import { ForwardRefExoticComponent, SVGProps } from 'react';
  9import { DataLimitResetStrategy } from 'types';
 10
 11const iconProps = {
 12  baseStyle: {
 13    strokeWidth: '2px',
 14    w: 4,
 15    h: 4,
 16  },
 17};
 18const ActiveStatusIcon = chakra(WifiIcon, iconProps);
 19const DisabledStatusIcon = chakra(NoSymbolIcon, iconProps);
 20const LimitedStatusIcon = chakra(ExclamationCircleIcon, iconProps);
 21const ExpiredStatusIcon = chakra(ClockIcon, iconProps);
 22const On_holdStatusIcon = chakra(ClockIcon, iconProps);
 23
 24export const resetStrategy: { title: string; value: DataLimitResetStrategy }[] =
 25  [
 26    {
 27      title: 'No',
 28      value: 'no_reset',
 29    },
 30    {
 31      title: 'Daily',
 32      value: 'day',
 33    },
 34    {
 35      title: 'Weekly',
 36      value: 'week',
 37    },
 38    {
 39      title: 'Monthly',
 40      value: 'month',
 41    },
 42    {
 43      title: 'Annually',
 44      value: 'year',
 45    },
 46  ];
 47
 48export const statusColors: {
 49  [key: string]: {
 50    statusColor: string;
 51    bandWidthColor: string;
 52    icon: ChakraComponent<ForwardRefExoticComponent<SVGProps<SVGSVGElement>>>;
 53  };
 54} = {
 55  active: {
 56    statusColor: 'green',
 57    bandWidthColor: 'primary',
 58    icon: ActiveStatusIcon,
 59  },
 60  connected: {
 61    statusColor: 'green',
 62    bandWidthColor: 'primary',
 63    icon: ActiveStatusIcon,
 64  },
 65  healthy: {
 66    statusColor: 'green',
 67    bandWidthColor: 'primary',
 68    icon: ActiveStatusIcon,
 69  },
 70  disabled: {
 71    statusColor: 'gray',
 72    bandWidthColor: 'gray',
 73    icon: DisabledStatusIcon,
 74  },
 75  expired: {
 76    statusColor: 'orange',
 77    bandWidthColor: 'orange',
 78    icon: ExpiredStatusIcon,
 79  },
 80  on_hold: {
 81    statusColor: 'purple',
 82    bandWidthColor: 'purple',
 83    icon: On_holdStatusIcon,
 84  },
 85  connecting: {
 86    statusColor: 'orange',
 87    bandWidthColor: 'orange',
 88    icon: ExpiredStatusIcon,
 89  },
 90  unhealthy: {
 91    statusColor: 'red',
 92    bandWidthColor: 'red',
 93    icon: LimitedStatusIcon,
 94  },
 95  limited: {
 96    statusColor: 'red',
 97    bandWidthColor: 'red',
 98    icon: LimitedStatusIcon,
 99  },
100  error: {
101    statusColor: 'red',
102    bandWidthColor: 'red',
103    icon: LimitedStatusIcon,
104  },
105};