https://dev.kronoz.win/r/marzneshin.git
| 1 |
4708fcb |
Dawsh |
2y ago |
import { |
| 2 |
4708fcb |
Dawsh |
2y ago |
SettingsDialogProps, |
| 3 |
4708fcb |
Dawsh |
2y ago |
SettingsDialog, |
| 4 |
4708fcb |
Dawsh |
2y ago |
Tabs, |
| 5 |
4708fcb |
Dawsh |
2y ago |
TabsContent, |
| 6 |
4708fcb |
Dawsh |
2y ago |
TabsList, |
| 7 |
4708fcb |
Dawsh |
2y ago |
TabsTrigger, |
| 8 |
4708fcb |
Dawsh |
2y ago |
} from "@marzneshin/components" |
| 9 |
4708fcb |
Dawsh |
2y ago |
import { type FC, useEffect } from "react" |
| 10 |
4708fcb |
Dawsh |
2y ago |
import { useTranslation } from "react-i18next" |
| 11 |
4708fcb |
Dawsh |
2y ago |
import { |
| 12 |
4708fcb |
Dawsh |
2y ago |
ServicesUsersTable, |
| 13 |
4708fcb |
Dawsh |
2y ago |
ServiceInboundsTable, |
| 14 |
4708fcb |
Dawsh |
2y ago |
ServiceType |
| 15 |
4708fcb |
Dawsh |
2y ago |
} from "@marzneshin/features/services"; |
| 16 |
4708fcb |
Dawsh |
2y ago |
|
| 17 |
4708fcb |
Dawsh |
2y ago |
interface ServicecSettingsDialogProps extends SettingsDialogProps { |
| 18 |
4708fcb |
Dawsh |
2y ago |
entity: ServiceType |
| 19 |
4708fcb |
Dawsh |
2y ago |
onClose: () => void; |
| 20 |
4708fcb |
Dawsh |
2y ago |
} |
| 21 |
4708fcb |
Dawsh |
2y ago |
|
| 22 |
4708fcb |
Dawsh |
2y ago |
export const ServiceSettingsDialog: FC<ServicecSettingsDialogProps> = ({ |
| 23 |
4708fcb |
Dawsh |
2y ago |
onOpenChange, open, entity, onClose |
| 24 |
4708fcb |
Dawsh |
2y ago |
}) => { |
| 25 |
4708fcb |
Dawsh |
2y ago |
const { t } = useTranslation(); |
| 26 |
4708fcb |
Dawsh |
2y ago |
|
| 27 |
4708fcb |
Dawsh |
2y ago |
useEffect(() => { |
| 28 |
4708fcb |
Dawsh |
2y ago |
if (!open) onClose(); |
| 29 |
4708fcb |
Dawsh |
2y ago |
}, [open, onClose]); |
| 30 |
4708fcb |
Dawsh |
2y ago |
|
| 31 |
4708fcb |
Dawsh |
2y ago |
return ( |
| 32 |
4708fcb |
Dawsh |
2y ago |
<SettingsDialog open={open} onOpenChange={onOpenChange}> |
| 33 |
4708fcb |
Dawsh |
2y ago |
<Tabs className="my-3 w-full h-full" defaultValue="inbounds"> |
| 34 |
4708fcb |
Dawsh |
2y ago |
<TabsList className="w-full"> |
| 35 |
4708fcb |
Dawsh |
2y ago |
<TabsTrigger className="w-full" value="inbounds">{t('inbounds')}</TabsTrigger> |
| 36 |
4708fcb |
Dawsh |
2y ago |
<TabsTrigger className="w-full" value="users">{t('users')}</TabsTrigger> |
| 37 |
4708fcb |
Dawsh |
2y ago |
</TabsList> |
| 38 |
4708fcb |
Dawsh |
2y ago |
<TabsContent value="inbounds" className="h-full"> |
| 39 |
4708fcb |
Dawsh |
2y ago |
<ServiceInboundsTable service={entity} /> |
| 40 |
4708fcb |
Dawsh |
2y ago |
</TabsContent> |
| 41 |
4708fcb |
Dawsh |
2y ago |
<TabsContent value="users" className="h-full"> |
| 42 |
4708fcb |
Dawsh |
2y ago |
<ServicesUsersTable service={entity} /> |
| 43 |
4708fcb |
Dawsh |
2y ago |
</TabsContent> |
| 44 |
4708fcb |
Dawsh |
2y ago |
</Tabs> |
| 45 |
4708fcb |
Dawsh |
2y ago |
</SettingsDialog> |
| 46 |
4708fcb |
Dawsh |
2y ago |
) |
| 47 |
4708fcb |
Dawsh |
2y ago |
} |