https://dev.kronoz.win/r/marzneshin.git
| 1 |
d377c4c |
Dawsh |
2y ago |
import { format } from "date-fns"; |
| 2 |
d377c4c |
Dawsh |
2y ago |
import { type FC } from 'react' |
| 3 |
e6e6467 |
Dawsh |
2y ago |
import { UserProp } from "@marzneshin/modules/users"; |
| 4 |
d377c4c |
Dawsh |
2y ago |
import { useTranslation } from "react-i18next"; |
| 5 |
d377c4c |
Dawsh |
2y ago |
|
| 6 |
d377c4c |
Dawsh |
2y ago |
export const UserExpirationValue: FC<UserProp> = ({ user }) => { |
| 7 |
d377c4c |
Dawsh |
2y ago |
const { t } = useTranslation(); |
| 8 |
d377c4c |
Dawsh |
2y ago |
return ({ |
| 9 |
d377c4c |
Dawsh |
2y ago |
start_on_first_use: user.usage_duration && `${(user.usage_duration / 86400)} Day`, |
| 10 |
d377c4c |
Dawsh |
2y ago |
fixed_date: user.expire_date && format(user.expire_date?.toLocaleString(), "PPP"), |
| 11 |
d377c4c |
Dawsh |
2y ago |
never: t('never'), |
| 12 |
d377c4c |
Dawsh |
2y ago |
}[user.expire_strategy]) |
| 13 |
d377c4c |
Dawsh |
2y ago |
} |
| 14 |
d377c4c |
Dawsh |
2y ago |
|