import { SlashCommandBuilder, EmbedBuilder, PermissionFlagsBits, ActionRowBuilder, ButtonBuilder, ButtonStyle } from 'discord.js';

export default {
  data: new SlashCommandBuilder()
    .setName('setup')
    .setDescription('Wizard setup awal: store, ticket, welcome, log channels')
    .setDefaultMemberPermissions(PermissionFlagsBits.Administrator),
  async execute(interaction) {
    const embed = new EmbedBuilder()
      .setTitle('⚙️ Setup Wizard')
      .setColor(0x5865f2)
      .setDescription([
        'Pilih komponen yang mau di-setup. Bot akan auto-create:',
        '',
        '🛒 **Store** — kategori store + welcome + product panel + #orders',
        '🎫 **Ticket System** — kategori ticket + panel + #ticket-logs',
        '👋 **Welcome** — channel #welcome + auto greet member baru',
        '📝 **Logs** — channel #audit-log + #join-leave',
        '🧰 **Full Setup** — semua di atas sekaligus (recommended)',
      ].join('\n'));

    const row = new ActionRowBuilder().addComponents(
      new ButtonBuilder().setCustomId('setup_store').setLabel('Store').setEmoji('🛒').setStyle(ButtonStyle.Primary),
      new ButtonBuilder().setCustomId('setup_ticket').setLabel('Ticket').setEmoji('🎫').setStyle(ButtonStyle.Primary),
      new ButtonBuilder().setCustomId('setup_welcome').setLabel('Welcome').setEmoji('👋').setStyle(ButtonStyle.Primary),
      new ButtonBuilder().setCustomId('setup_logs').setLabel('Logs').setEmoji('📝').setStyle(ButtonStyle.Primary),
      new ButtonBuilder().setCustomId('setup_full').setLabel('Full Setup').setEmoji('🧰').setStyle(ButtonStyle.Success),
    );

    await interaction.reply({ embeds: [embed], components: [row], ephemeral: true });
  },
};
