store/resources/js/pages/admin/system/setting/Index.vue
Yoga Pangestu ee9bff3043
Some checks are pending
linter / quality (push) Waiting to run
tests / ci (8.3) (push) Waiting to run
tests / ci (8.4) (push) Waiting to run
tests / ci (8.5) (push) Waiting to run
feat: replace OwnerVerificationService with PushNotificationService and update notification logic in SettingController and MarketplaceService
2026-07-20 23:02:28 +07:00

53 lines
2.0 KiB
Vue

<script setup lang="ts">
import { Head } from '@inertiajs/vue3';
import { ref } from 'vue';
import { useCan } from '@/composables/useCan';
import { SettingSection as SettingSectionConst } from '@/constants/setting-section';
import SettingLayout from '@/layouts/SettingLayout.vue';
import type {
HomepageSettingsData,
HrSettingsData,
MarketplaceSettingsData,
SettingSection,
SocialMediaSettingsData,
SystemSettingsData,
} from '@/types/setting';
import HomepageSection from './form/HomepageSection.vue';
import HrSection from './form/HrSection.vue';
import MarketplaceSection from './form/MarketplaceSection.vue';
import SocialMediaSection from './form/SocialMediaSection.vue';
import SystemSection from './form/SystemSection.vue';
defineProps<{
system: SystemSettingsData;
socialMedia: SocialMediaSettingsData;
marketplace: MarketplaceSettingsData;
hr: HrSettingsData;
homepage: HomepageSettingsData;
canUpdateSystem: boolean;
canUpdateSocialMedia: boolean;
canUpdateMarketplace: boolean;
canUpdateHr: boolean;
canUpdateHomepage: boolean;
}>();
const { hasRole } = useCan();
const activeSection = ref<SettingSection>(
hasRole('admin-toko') ? SettingSectionConst.MARKETPLACE : SettingSectionConst.SYSTEM
);
</script>
<template>
<Head title="Pengaturan" />
<SettingLayout v-model:section="activeSection">
<SystemSection v-if="activeSection === SettingSectionConst.SYSTEM" :data="system" :can-update="canUpdateSystem" />
<HomepageSection v-else-if="activeSection === SettingSectionConst.HOMEPAGE" :data="homepage" :can-update="canUpdateHomepage" />
<SocialMediaSection v-else-if="activeSection === SettingSectionConst.SOCIAL" :data="socialMedia" :can-update="canUpdateSocialMedia" />
<MarketplaceSection v-else-if="activeSection === SettingSectionConst.MARKETPLACE" :data="marketplace" :can-update="canUpdateMarketplace" />
<HrSection v-else-if="activeSection === SettingSectionConst.HR" :data="hr" :can-update="canUpdateHr" />
</SettingLayout>
</template>