From 5ce7cbe79189f079b3689f230d54648bd870800f Mon Sep 17 00:00:00 2001 From: aliirz Date: Sun, 12 Apr 2026 23:04:30 +0300 Subject: [PATCH 1/4] provincial assemblies data added --- app/[locale]/about/page.tsx | 171 ++++ app/[locale]/admin/dashboard/page.tsx | 187 ++++ app/[locale]/admin/upload/page.tsx | 225 +++++ app/[locale]/auth/callback/page.tsx | 104 ++ app/[locale]/bills/[id]/loading.tsx | 38 + app/[locale]/bills/[id]/page.tsx | 68 ++ app/[locale]/bills/page.tsx | 173 ++++ app/[locale]/chat.backup/page.tsx | 295 ++++++ app/[locale]/chat/page.tsx | 263 +++++ .../components/message-threads-sidebar.tsx | 185 ++++ app/[locale]/constitution/page.tsx | 131 +++ app/[locale]/layout.tsx | 103 ++ app/[locale]/page.tsx | 145 +++ app/[locale]/proceedings/[id]/loading.tsx | 32 + app/[locale]/proceedings/[id]/page.tsx | 42 + app/[locale]/proceedings/page.tsx | 155 +++ app/[locale]/representatives/[id]/page.tsx | 343 +++++++ app/[locale]/representatives/page.tsx | 480 +++++++++ app/api/representatives/[id]/route.ts | 6 +- app/api/representatives/by-location/route.ts | 5 +- app/api/representatives/filters/route.ts | 14 + app/api/representatives/nearby/route.ts | 5 +- app/api/representatives/route.ts | 21 +- app/representatives/[id]/page.tsx | 8 +- app/representatives/page.tsx | 71 +- components/language-switcher.tsx | 28 + config/site.ts | 2 +- i18n/navigation.ts | 5 + i18n/request.ts | 14 + i18n/routing.ts | 9 + lib/assemblies.ts | 66 ++ .../migrations/0006_groovy_peter_parker.sql | 16 + lib/db/migrations/meta/0006_snapshot.json | 946 ++++++++++++++++++ lib/db/migrations/meta/_journal.json | 7 + lib/db/schema/representatives.ts | 38 +- lib/fonts.ts | 13 +- lib/representative-image.ts | 28 + messages/en.json | 228 +++++ messages/ur.json | 228 +++++ middleware.ts | 8 + next.config.mjs | 18 +- package.json | 1 + .../abdul_khaliq_khan_achakzai-51.jpg | Bin 0 -> 7541 bytes .../balochistan/abdul_majeed_badini-16.jpg | Bin 0 -> 11526 bytes .../balochistan/abdul_malik_baloch-26.jpg | Bin 0 -> 15204 bytes .../balochistan/ali_hasan_zehri-21.jpg | Bin 0 -> 5618 bytes .../balochistan/ali_madad_jattak-45.jpg | Bin 0 -> 10425 bytes .../balochistan/asfand_yar_khan_kakar-47.jpg | Bin 0 -> 14353 bytes .../balochistan/asghar_ali_tareen-48.jpg | Bin 0 -> 11646 bytes .../balochistan/ashok_kumar-65.jpg | Bin 0 -> 7945 bytes .../balochistan/bakht_muhammad-39.jpg | Bin 0 -> 19102 bytes .../balochistan/barkat_ali_rind-27.jpg | Bin 0 -> 15699 bytes .../balochistan/farah_azeem_shah-54.jpg | Bin 0 -> 13322 bytes .../balochistan/fazal_qadir-2.jpg | Bin 0 -> 10004 bytes .../balochistan/ghazala_gola_begum-52.jpg | Bin 0 -> 13897 bytes .../balochistan/hadiya_nawaz-57.jpg | Bin 0 -> 7891 bytes .../balochistan/khair_jan_baloch-23.jpg | Bin 0 -> 14457 bytes .../balochistan/malik_naeem_khan_bazai-38.jpg | Bin 0 -> 14608 bytes .../balochistan/meena_majeed-64.jpg | Bin 0 -> 12652 bytes .../balochistan/mir_asadullah_baloch-29.jpg | Bin 0 -> 12105 bytes .../mir_ghulam_dastagir_badeni-34.jpg | Bin 0 -> 14667 bytes .../balochistan/mir_jehanzaib_mengal-20.jpg | Bin 0 -> 12134 bytes .../balochistan/mir_liaqat_ali_lehri-43.jpg | Bin 0 -> 13896 bytes .../mir_mohammad_asim_kurd_gello-12.jpg | Bin 0 -> 13684 bytes .../mir_muhammad_asghar_rind-28.jpg | Bin 0 -> 17530 bytes .../mir_muhammad_sadiq_umrani-13.jpg | Bin 0 -> 10942 bytes .../balochistan/mir_samad_khan_gorgage-40.jpg | Bin 0 -> 12323 bytes .../mir_sarfraz_ahmed_bugti-10.jpg | Bin 0 -> 12380 bytes .../balochistan/mir_shoaib_nusherwani-33.jpg | Bin 0 -> 14833 bytes .../balochistan/mir_ubaidullah_gorgage-44.jpg | Bin 0 -> 12067 bytes .../balochistan/mir_younas_aziz_zehri-19.jpg | Bin 0 -> 13408 bytes .../balochistan/mir_zabid_ali_reki-31.jpg | Bin 0 -> 19323 bytes .../mir_zafarullah_khan_zehri-35.jpg | Bin 0 -> 8439 bytes .../mir_zahoor_ahmed_buledi-25.jpg | Bin 0 -> 18044 bytes .../balochistan/mir_zia_ullah_langov-36.jpg | Bin 0 -> 13110 bytes .../balochistan/molvi_noorullah-3.jpg | Bin 0 -> 17034 bytes .../moulana_hidayat_ur_rehman_baloch-24.jpg | Bin 0 -> 20268 bytes .../balochistan/muhammad_khan_lehri-14.jpg | Bin 0 -> 12402 bytes .../balochistan/muhammad_khan_toor-5.jpg | Bin 0 -> 15255 bytes .../balochistan/muhammad_nawaz-1.jpg | Bin 0 -> 11031 bytes .../muhammad_sadiq_sanjrani-32.jpg | Bin 0 -> 13064 bytes .../nawab_jangayz_khan_marri-9.jpg | Bin 0 -> 15872 bytes .../nawab_muhammad_aslam_khan_raisani-37.jpg | Bin 0 -> 15258 bytes .../balochistan/nawab_sanaullah_zehri-18.jpg | Bin 0 -> 12302 bytes ...awabzada_muhammad_zarain_khan_magsi-22.jpg | Bin 0 -> 10528 bytes .../balochistan/nawabzada_tariq_magsi-11.jpg | Bin 0 -> 14376 bytes .../balochistan/noor_muhammad_dummar-7.jpg | Bin 0 -> 13858 bytes .../prince_ahmed_omar_ahmedzai-46.jpg | Bin 0 -> 10810 bytes .../raheela_hameed_khan_durrani-55.jpg | Bin 0 -> 11430 bytes .../balochistan/ravi_pahuja-53.jpg | Bin 0 -> 15342 bytes .../balochistan/rehmat_saleh_baloch-30.jpg | Bin 0 -> 16460 bytes .../balochistan/rubaba_khan_buledi-58.jpg | Bin 0 -> 25458 bytes .../balochistan/safia_fazlur_rehman-60.jpg | Bin 0 -> 19295 bytes .../balochistan/saleem_ahmed-15.jpg | Bin 0 -> 14458 bytes .../balochistan/salma_bibi-62.jpg | Bin 0 -> 20913 bytes .../balochistan/sanjay_kumar-63.jpg | Bin 0 -> 13647 bytes .../sardar_abdul_rehman_kehtran-4.jpg | Bin 0 -> 10397 bytes .../sardar_masood_ali_khan_luni-6.jpg | Bin 0 -> 13736 bytes .../sardar_mir_kohyar_khan_domki-8.jpg | Bin 0 -> 15350 bytes .../sardarzada_faisal_khan_jamali-17.jpg | Bin 0 -> 18084 bytes .../balochistan/shahida_rauf-59.jpg | Bin 0 -> 24102 bytes .../balochistan/shehnaz_umrani-56.jpg | Bin 0 -> 15668 bytes .../balochistan/syed_zafar_ali_agha-49.jpg | Bin 0 -> 14508 bytes .../balochistan/ume_kalsoom-61.jpg | Bin 0 -> 18454 bytes .../balochistan/wali_muhammad_noorzai-41.jpg | Bin 0 -> 22993 bytes .../balochistan/zamarak_khan-50.jpg | Bin 0 -> 10174 bytes .../balochistan/zarak_khan-42.jpg | Bin 0 -> 11463 bytes public/representatives/kp/abdul_ghani-71.jpg | Bin 0 -> 11653 bytes .../kp/abdul_kabir_khan-27.jpg | Bin 0 -> 11531 bytes .../kp/abdul_karim_khan-51.jpg | Bin 0 -> 13823 bytes public/representatives/kp/abdul_munim-29.jpg | Bin 0 -> 7620 bytes public/representatives/kp/adnan_khan-101.jpg | Bin 0 -> 14276 bytes .../representatives/kp/afshan_hussain-130.jpg | Bin 0 -> 18537 bytes public/representatives/kp/aftab_alam-90.jpg | Bin 0 -> 8392 bytes public/representatives/kp/ahmad_kundi-112.jpg | Bin 0 -> 5459 bytes .../kp/aiman_jalil_jan-122.jpg | Bin 0 -> 9282 bytes public/representatives/kp/ajab_gul-110.jpg | Bin 0 -> 9966 bytes public/representatives/kp/ajmal_khan-21.jpg | Bin 0 -> 5347 bytes .../representatives/kp/akbar_ayub_khan-46.jpg | Bin 0 -> 5068 bytes public/representatives/kp/akhtar_khan-5.jpg | Bin 0 -> 8027 bytes .../kp/akram_khan_durrani-102.jpg | Bin 0 -> 10629 bytes .../kp/ali_amin_gandapur-113.jpg | Bin 0 -> 12772 bytes public/representatives/kp/ali_hadi-96.jpg | Bin 0 -> 12255 bytes public/representatives/kp/ali_shah-4.jpg | Bin 0 -> 10003 bytes .../representatives/kp/amina_sardar-128.jpg | Bin 0 -> 9035 bytes .../kp/amir_farzand_khan-56.jpg | Bin 0 -> 13661 bytes public/representatives/kp/amjad_ali-7.jpg | Bin 0 -> 5384 bytes .../representatives/kp/anwar_zeb_khan-20.jpg | Bin 0 -> 6110 bytes .../representatives/kp/aqib_ullah_khan-50.jpg | Bin 0 -> 13674 bytes .../kp/arbab_muhammad_usman_khan-75.jpg | Bin 0 -> 17459 bytes .../kp/arbab_muhammad_waseem_khan-73.jpg | Bin 0 -> 8988 bytes .../kp/arbab_zarak_khan-80.jpg | Bin 0 -> 5372 bytes public/representatives/kp/arifa_bibi-127.jpg | Bin 0 -> 8715 bytes public/representatives/kp/arshad_ali-63.jpg | Bin 0 -> 7052 bytes .../kp/arshad_ayub_khan-47.jpg | Bin 0 -> 1993 bytes .../kp/ashbar_jan_jadoon-137.jpg | Bin 0 -> 12851 bytes public/representatives/kp/asif_khan-109.jpg | Bin 0 -> 10402 bytes .../representatives/kp/asker_pervaiz-142.jpg | Bin 0 -> 11354 bytes public/representatives/kp/asma_alam-117.jpg | Bin 0 -> 10198 bytes .../representatives/kp/aurangzeb_khan-94.jpg | Bin 0 -> 12213 bytes .../kp/babar_saleem_swati-37.jpg | Bin 0 -> 14083 bytes public/representatives/kp/beari_lal-145.jpg | Bin 0 -> 11334 bytes public/representatives/kp/daud_shah-91.jpg | Bin 0 -> 8400 bytes .../kp/ehsan_ullah_khan-115.jpg | Bin 0 -> 8707 bytes .../kp/faisal_khan_tarakai-52.jpg | Bin 0 -> 8580 bytes public/representatives/kp/faiza_malik-129.jpg | Bin 0 -> 11898 bytes public/representatives/kp/farah_khan-133.jpg | Bin 0 -> 16184 bytes .../kp/farzana_shereen-138.jpg | Bin 0 -> 12015 bytes .../kp/fateh_ul_mulk_ali_nasir-2.jpg | Bin 0 -> 7324 bytes public/representatives/kp/fazal_elahi-84.jpg | Bin 0 -> 3392 bytes .../kp/fazal_hakeem_khan-6.jpg | Bin 0 -> 5514 bytes public/representatives/kp/fazal_haq-31.jpg | Bin 0 -> 7399 bytes .../kp/fazal_shakoor_khan-65.jpg | Bin 0 -> 2043 bytes .../kp/gul_ibrahim_khan-11.jpg | Bin 0 -> 10723 bytes .../representatives/kp/gurpal_singh-143.jpg | Bin 0 -> 10508 bytes .../representatives/kp/hamid_ur_rahman-8.jpg | Bin 0 -> 9668 bytes .../representatives/kp/hamid_ur_rehman-19.jpg | Bin 0 -> 8772 bytes .../kp/hisham_inam_ullah_khan-106.jpg | Bin 0 -> 6841 bytes public/representatives/kp/humayun_khan-15.jpg | Bin 0 -> 5257 bytes .../representatives/kp/ibadullah_khan-30.jpg | Bin 0 -> 8426 bytes .../kp/iftikhar_ali_mashwani-60.jpg | Bin 0 -> 2190 bytes .../representatives/kp/iftikhar_jadoon-44.jpg | Bin 0 -> 7994 bytes .../kp/iftikhar_ullah_jan-64.jpg | Bin 0 -> 8713 bytes public/representatives/kp/ihtisham_ali-61.jpg | Bin 0 -> 11683 bytes .../representatives/kp/ijaz_muhammad-74.jpg | Bin 0 -> 7946 bytes public/representatives/kp/ikram_ullah-39.jpg | Bin 0 -> 8107 bytes public/representatives/kp/ishfaq_ahmad-89.jpg | Bin 0 -> 8529 bytes public/representatives/kp/jalal_khan-79.jpg | Bin 0 -> 7849 bytes .../representatives/kp/jamila_paracha-132.jpg | Bin 0 -> 16410 bytes .../representatives/kp/johar_muhammad-105.jpg | Bin 0 -> 7945 bytes .../representatives/kp/khadija_bibi-140.jpg | Bin 0 -> 12504 bytes .../kp/khaleeq_ur_rehman-87.jpg | Bin 0 -> 11412 bytes public/representatives/kp/khalid_khan-62.jpg | Bin 0 -> 8099 bytes .../kp/kiramat_ullah_khan-72.jpg | Bin 0 -> 11283 bytes .../kp/laiq_muhammad_khan-41.jpg | Bin 0 -> 7720 bytes .../representatives/kp/liaqat_ali_khan-18.jpg | Bin 0 -> 8420 bytes .../representatives/kp/lutf_ur_rahman-114.jpg | Bin 0 -> 2052 bytes .../kp/madina_gul_afridi-123.jpg | Bin 0 -> 6275 bytes public/representatives/kp/mahboob_sher-67.jpg | Bin 0 -> 9046 bytes ...akhdoom_zada_muhammad_aftab_haider-111.jpg | Bin 0 -> 9669 bytes .../kp/malik_adeel_lqbal-48.jpg | Bin 0 -> 19197 bytes .../kp/malik_tariq_awan-82.jpg | Bin 0 -> 15224 bytes public/representatives/kp/meena_khan-83.jpg | Bin 0 -> 18774 bytes .../representatives/kp/meher_sultana-136.jpg | Bin 0 -> 15535 bytes .../kp/mian_muhammad_umar-88.jpg | Bin 0 -> 9891 bytes .../kp/muhammad_abdul_salam-58.jpg | Bin 0 -> 12257 bytes .../kp/muhammad_adnan_qadri-69.jpg | Bin 0 -> 8833 bytes .../kp/muhammad_anwar_khan-13.jpg | Bin 0 -> 11054 bytes .../representatives/kp/muhammad_arif-66.jpg | Bin 0 -> 8740 bytes .../kp/muhammad_azam_khan-14.jpg | Bin 0 -> 9470 bytes .../representatives/kp/muhammad_idrees-86.jpg | Bin 0 -> 4687 bytes .../kp/muhammad_iqbal_khan-103.jpg | Bin 0 -> 5789 bytes .../representatives/kp/muhammad_israr-68.jpg | Bin 0 -> 10983 bytes .../kp/muhammad_khursheed-97.jpg | Bin 0 -> 10774 bytes .../representatives/kp/muhammad_naeem-10.jpg | Bin 0 -> 9138 bytes .../kp/muhammad_nisar_baaz-22.jpg | Bin 0 -> 11194 bytes .../kp/muhammad_rashad_khan-28.jpg | Bin 0 -> 9431 bytes .../representatives/kp/muhammad_riaz-33.jpg | Bin 0 -> 5571 bytes .../representatives/kp/muhammad_sajjad-98.jpg | Bin 0 -> 10118 bytes .../kp/muhammad_sohail_afridi-70.jpg | Bin 0 -> 15767 bytes .../representatives/kp/muhammad_usman-108.jpg | Bin 0 -> 10134 bytes .../representatives/kp/muhammad_yamin-12.jpg | Bin 0 -> 10929 bytes .../kp/muhammad_zahir_shah-57.jpg | Bin 0 -> 8652 bytes .../representatives/kp/munir_hussain-36.jpg | Bin 0 -> 9411 bytes .../kp/murtaza_khan_tarakai-53.jpg | Bin 0 -> 9855 bytes public/representatives/kp/musavir_khan-24.jpg | Bin 0 -> 9033 bytes .../kp/mushtaq_ahmed_ghani-45.jpg | Bin 0 -> 12051 bytes public/representatives/kp/nadia_sher-139.jpg | Bin 0 -> 19028 bytes .../representatives/kp/naheeda_noor-126.jpg | Bin 0 -> 11475 bytes .../kp/nazir_ahmed_abbasi-42.jpg | Bin 0 -> 10625 bytes .../representatives/kp/neelofar_babar-120.jpg | Bin 0 -> 12448 bytes .../representatives/kp/neelofer_begum-125.jpg | Bin 0 -> 5048 bytes .../kp/nek_muhammad_khan-104.jpg | Bin 0 -> 8825 bytes .../kp/pakhtoon_yar_khan-100.jpg | Bin 0 -> 6512 bytes .../kp/rajab_ali_khan_abbasi-43.jpg | Bin 0 -> 10955 bytes public/representatives/kp/rangez_ahmad-49.jpg | Bin 0 -> 10636 bytes .../representatives/kp/rehana_ismail-116.jpg | Bin 0 -> 19374 bytes public/representatives/kp/riaz_khan-25.jpg | Bin 0 -> 13353 bytes public/representatives/kp/sajjad_ullah-32.jpg | Bin 0 -> 12306 bytes .../representatives/kp/sami_ullah_khan-76.jpg | Bin 0 -> 7374 bytes .../kp/sardar_shahjehan_yousaf-40.jpg | Bin 0 -> 8353 bytes public/representatives/kp/shafi_ullah-16.jpg | Bin 0 -> 8230 bytes .../representatives/kp/shafi_ullah_jan-92.jpg | Bin 0 -> 8812 bytes .../kp/shah_abu_turab_khan_bangash-93.jpg | Bin 0 -> 9489 bytes public/representatives/kp/shahida-141.jpg | Bin 0 -> 18242 bytes .../representatives/kp/shakeel_ahmed-23.jpg | Bin 0 -> 7312 bytes public/representatives/kp/sharafat_ali-3.jpg | Bin 0 -> 9141 bytes .../representatives/kp/shazia_jadoon-131.jpg | Bin 0 -> 11435 bytes .../kp/shazia_tehmas_khan-135.jpg | Bin 0 -> 14711 bytes public/representatives/kp/shehla_bano-119.jpg | Bin 0 -> 8401 bytes .../representatives/kp/sher_ali_afridi-77.jpg | Bin 0 -> 9333 bytes .../representatives/kp/sobia_shahid-118.jpg | Bin 0 -> 16000 bytes public/representatives/kp/sultan_room-9.jpg | Bin 0 -> 7985 bytes .../representatives/kp/suresh_kumar-144.jpg | Bin 0 -> 11217 bytes public/representatives/kp/suriya_bibi-1.jpg | Bin 0 -> 15327 bytes .../kp/syed_fakhar_jehan-26.jpg | Bin 0 -> 10394 bytes .../kp/syed_qasim_ali_shah-81.jpg | Bin 0 -> 11637 bytes .../kp/syeda_sonia_hussain-134.jpg | Bin 0 -> 14005 bytes public/representatives/kp/taj_muhammad-35.jpg | Bin 0 -> 10423 bytes .../kp/tariq_mehmood_aryani-59.jpg | Bin 0 -> 10079 bytes public/representatives/kp/tariq_saeed-107.jpg | Bin 0 -> 9095 bytes public/representatives/kp/tufail_anjum-55.jpg | Bin 0 -> 12387 bytes .../representatives/kp/ubaidur_rahman-17.jpg | Bin 0 -> 17060 bytes .../representatives/kp/zahid_chanzeb-38.jpg | Bin 0 -> 8322 bytes .../kp/zahid_ullah_khan-99.jpg | Bin 0 -> 11467 bytes public/representatives/kp/zahir_khan-78.jpg | Bin 0 -> 12016 bytes .../representatives/kp/zar_alam_khan-85.jpg | Bin 0 -> 8195 bytes public/representatives/kp/zarshad_khan-54.jpg | Bin 0 -> 12137 bytes public/representatives/kp/zubair_khan-34.jpg | Bin 0 -> 13316 bytes .../representatives/sindh/abdul_basit-1.jpg | Bin 0 -> 2651 bytes .../sindh/abdul_rauf_khoso-2.jpg | Bin 0 -> 5655 bytes .../sindh/abdul_razaq_raja-3.jpg | Bin 0 -> 3305 bytes .../representatives/sindh/abdul_waseem-4.jpg | Bin 0 -> 3397 bytes .../sindh/adil_altaf_unar-5.jpg | Bin 0 -> 2543 bytes .../representatives/sindh/adil_askari-6.jpg | Bin 0 -> 3226 bytes .../sindh/agha_shahbaz_ali_durrani-7.jpg | Bin 0 -> 7551 bytes .../sindh/aijaz_hussain_shah-8.jpg | Bin 0 -> 3365 bytes public/representatives/sindh/ajaz_khan-9.jpg | Bin 0 -> 3250 bytes public/representatives/sindh/ali_ahmed-10.jpg | Bin 0 -> 3383 bytes .../representatives/sindh/ali_hassan-11.jpg | Bin 0 -> 2676 bytes .../representatives/sindh/ali_hassan-12.jpg | Bin 0 -> 3832 bytes .../sindh/ali_khurshidi-13.jpg | Bin 0 -> 2633 bytes .../sindh/ali_nawaz_khan_mahar-14.jpg | Bin 0 -> 3333 bytes .../sindh/allah_bux_talpur-15.jpg | Bin 0 -> 3502 bytes .../sindh/ameer_ali_shah-16.jpg | Bin 0 -> 2779 bytes .../representatives/sindh/aneel_kumar-17.jpg | Bin 0 -> 3642 bytes .../sindh/anthony_naveed-18.jpg | Bin 0 -> 4498 bytes .../sindh/arbab_amir_amanullah-19.jpg | Bin 0 -> 3558 bytes .../sindh/arbab_lutfullah-20.jpg | Bin 0 -> 3591 bytes .../sindh/arooba_rabbani-21.jpg | Bin 0 -> 3337 bytes .../sindh/arsalan_perwaiz-22.jpg | Bin 0 -> 4187 bytes .../sindh/awais_qadir_shah-23.jpg | Bin 0 -> 6597 bytes .../sindh/azra_fazal_pechuho-24.jpg | Bin 0 -> 3907 bytes .../sindh/bahadur_khan_dahri-25.jpg | Bin 0 -> 2950 bytes .../sindh/bibi_yasmeen_shah-26.jpg | Bin 0 -> 4231 bytes .../sindh/bilal_hussain_khan_jadoon-27.jpg | Bin 0 -> 3174 bytes .../sindh/bilqees_mukhtar-28.jpg | Bin 0 -> 3255 bytes .../sindh/dost_muhammad-29.jpg | Bin 0 -> 3516 bytes .../sindh/ejaz_ul_haque-30.jpg | Bin 0 -> 3325 bytes .../representatives/sindh/fahim_ahmed-31.jpg | Bin 0 -> 3740 bytes .../representatives/sindh/faisal_rafiq-32.jpg | Bin 0 -> 3404 bytes .../representatives/sindh/fakhar_zaman-33.jpg | Bin 0 -> 3491 bytes .../faqeer_sher_muhammad_bilalani-34.jpg | Bin 0 -> 3726 bytes .../representatives/sindh/farah_sohail-35.jpg | Bin 0 -> 3881 bytes .../sindh/farhan_ansari-36.jpg | Bin 0 -> 3349 bytes .../sindh/farukh_ahmed_shah-37.jpg | Bin 0 -> 3877 bytes .../sindh/faryal_talpur-38.jpg | Bin 0 -> 18571 bytes .../sindh/farzana_hanif-39.jpg | Bin 0 -> 4754 bytes .../sindh/fayaz_ali_butt-40.jpg | Bin 0 -> 3137 bytes .../sindh/fouzia_hameed-41.jpg | Bin 0 -> 2612 bytes .../representatives/sindh/ghulam_abid-42.jpg | Bin 0 -> 3607 bytes .../sindh/ghulam_qadir_chandio-43.jpg | Bin 0 -> 3958 bytes .../representatives/sindh/giyanoo_mal-44.jpg | Bin 0 -> 4039 bytes .../sindh/hallar_wassan-45.jpg | Bin 0 -> 3064 bytes public/representatives/sindh/hari_ram-46.jpg | Bin 0 -> 3195 bytes .../sindh/hassan_ali_shah-47.jpg | Bin 0 -> 12037 bytes public/representatives/sindh/heer_soho-48.jpg | Bin 0 -> 4394 bytes .../sindh/hina_dastagir-49.jpg | Bin 0 -> 3782 bytes .../sindh/ikramullah_khan_dharejo-50.jpg | Bin 0 -> 6370 bytes .../sindh/imdad_ali_pitafi-51.jpg | Bin 0 -> 3008 bytes .../sindh/imtiaz_ahmed_shaikh-52.jpg | Bin 0 -> 5636 bytes .../sindh/jam_khan_shoro-53.jpg | Bin 0 -> 3087 bytes .../representatives/sindh/jamal_ahmed-54.jpg | Bin 0 -> 3481 bytes .../representatives/sindh/jameel_ahmed-55.jpg | Bin 0 -> 2872 bytes .../representatives/sindh/javed_iqbal-56.jpg | Bin 0 -> 3556 bytes .../representatives/sindh/khairunisa-57.jpg | Bin 0 -> 3031 bytes .../representatives/sindh/khan_chandio-58.jpg | Bin 0 -> 3682 bytes .../sindh/khatumal_jeewan-59.jpg | Bin 0 -> 2987 bytes .../sindh/khurram_karim_soomro-60.jpg | Bin 0 -> 3245 bytes .../representatives/sindh/kiran_masood-61.jpg | Bin 0 -> 4010 bytes .../sindh/liaquat_ali_askani-62.jpg | Bin 0 -> 3002 bytes .../sindh/mahesh_kumar_hasija-63.jpg | Bin 0 -> 3612 bytes .../sindh/mahmood_alam_jamot-64.jpg | Bin 0 -> 3100 bytes .../sindh/mahtab_hussain_dahar-65.jpg | Bin 0 -> 3730 bytes .../sindh/maleeha_manzoor-66.jpg | Bin 0 -> 2579 bytes .../sindh/malik_sikander_khan-67.jpg | Bin 0 -> 2690 bytes .../sindh/mehboob_ali_khan_bijarani-68.jpg | Bin 0 -> 3431 bytes .../sindh/mehboob_zaman-69.jpg | Bin 0 -> 3372 bytes .../representatives/sindh/moid_anver-70.jpg | Bin 0 -> 2774 bytes .../sindh/muhammad_aamir_siddiqui-71.jpg | Bin 0 -> 3096 bytes .../sindh/muhammad_ali_malkani-72.jpg | Bin 0 -> 2852 bytes .../sindh/muhammad_arif_khan_mahar-73.jpg | Bin 0 -> 3181 bytes .../sindh/muhammad_asif-74.jpg | Bin 0 -> 6803 bytes .../sindh/muhammad_asif_khan-75.jpg | Bin 0 -> 3592 bytes .../sindh/muhammad_bux_khan_mahar-76.jpg | Bin 0 -> 3420 bytes .../sindh/muhammad_daniyal-77.jpg | Bin 0 -> 3156 bytes .../sindh/muhammad_dilawar-78.jpg | Bin 0 -> 3586 bytes .../sindh/muhammad_farooq-79.jpg | Bin 0 -> 3750 bytes .../sindh/muhammad_farooq_awan-80.jpg | Bin 0 -> 3589 bytes .../sindh/muhammad_halepota-81.jpg | Bin 0 -> 3962 bytes .../sindh/muhammad_iftikhar_alam-82.jpg | Bin 0 -> 2317 bytes .../sindh/muhammad_ismail_rahoo-83.jpg | Bin 0 -> 3572 bytes .../sindh/muhammad_maaz_mehboob-84.jpg | Bin 0 -> 2756 bytes .../sindh/muhammad_mazahir_amir-85.jpg | Bin 0 -> 2748 bytes .../sindh/muhammad_owais-86.jpg | Bin 0 -> 2769 bytes .../sindh/muhammad_qasim-87.jpg | Bin 0 -> 3668 bytes .../sindh/muhammad_rashid_khan-88.jpg | Bin 0 -> 3256 bytes .../sindh/muhammad_rehan_rajput-89.jpg | Bin 0 -> 3081 bytes .../sindh/muhammad_sajid-90.jpg | Bin 0 -> 3043 bytes .../sindh/muhammad_saleem-91.jpg | Bin 0 -> 4398 bytes .../sindh/muhammad_shabbir_qureshi-92.jpg | Bin 0 -> 3243 bytes .../sindh/muhammad_taimur_talpur-93.jpg | Bin 0 -> 3619 bytes .../sindh/muhammad_usman-94.jpg | Bin 0 -> 4270 bytes .../sindh/muhammad_yousuf-95.jpg | Bin 0 -> 2908 bytes .../sindh/muhammad_yousuf_baloch-96.jpg | Bin 0 -> 3654 bytes .../sindh/mujeeb_ul_haq-97.jpg | Bin 0 -> 2511 bytes .../sindh/mukesh_kumar_chawla-98.jpg | Bin 0 -> 3095 bytes .../sindh/mumtaz_ali_chandio-99.jpg | Bin 0 -> 3173 bytes .../sindh/mumtaz_hussain_khan-100.jpg | Bin 0 -> 3793 bytes .../sindh/murad_ali_shah-101.jpg | Bin 0 -> 4037 bytes .../sindh/musarrat_jabeen-102.jpg | Bin 0 -> 6699 bytes .../sindh/nadir_akmal_khan_leghari-103.jpg | Bin 0 -> 3418 bytes .../sindh/nadir_ali_magsi-104.jpg | Bin 0 -> 2781 bytes .../sindh/naeem_ahmed_kharal-105.jpg | Bin 0 -> 2634 bytes .../representatives/sindh/najam_mirza-106.jpg | Bin 0 -> 3595 bytes .../sindh/naseer_ahmed-107.jpg | Bin 0 -> 3355 bytes .../sindh/nasir_hussain_qureshi-108.jpg | Bin 0 -> 3625 bytes .../sindh/nasir_hussain_shah_rizvi-109.jpg | Bin 0 -> 3187 bytes .../sindh/nawabzada_burhan_chandio-110.jpg | Bin 0 -> 3728 bytes .../representatives/sindh/nida_khuhro-111.jpg | Bin 0 -> 3162 bytes .../sindh/nisar_ahmed_khuhro-112.jpg | Bin 0 -> 3415 bytes .../sindh/noor_ahmed_bhurgri-113.jpg | Bin 0 -> 3208 bytes .../sindh/nuhzat_pathan-114.jpg | Bin 0 -> 5227 bytes .../representatives/sindh/paras_dero-115.jpg | Bin 0 -> 4329 bytes .../sindh/qaim_ali_shah-116.jpg | Bin 0 -> 3968 bytes .../sindh/qurat_ul_ain_khan-117.jpg | Bin 0 -> 2278 bytes .../sindh/rana_hamir_singh-118.jpg | Bin 0 -> 2973 bytes .../representatives/sindh/rehan_akram-119.jpg | Bin 0 -> 4059 bytes .../sindh/rehan_bandukda-120.jpg | Bin 0 -> 2217 bytes .../sindh/rehana_laghari-121.jpg | Bin 0 -> 3582 bytes .../sindh/riaz_hussain_shah_sheerazi-122.jpg | Bin 0 -> 4350 bytes .../sindh/rooma_sabahat-123.jpg | Bin 0 -> 3912 bytes .../sindh/rukhsana_perveen-124.jpg | Bin 0 -> 3717 bytes .../sindh/sabir_hussain_kaimkhani-125.jpg | Bin 0 -> 3424 bytes .../sindh/sadhumal_surendar_valasai-126.jpg | Bin 0 -> 3609 bytes .../representatives/sindh/sadia_javed-127.jpg | Bin 0 -> 3349 bytes .../representatives/sindh/saeed_ghani-128.jpg | Bin 0 -> 3231 bytes .../representatives/sindh/saima_agha-129.jpg | Bin 0 -> 3913 bytes public/representatives/sindh/sajeela-130.jpg | Bin 0 -> 3420 bytes .../sindh/sajid_ali_banbhan-131.jpg | Bin 0 -> 3348 bytes .../sindh/sajid_hussain-132.jpg | Bin 0 -> 2909 bytes .../sindh/sajjad_ali_soomro-133.jpg | Bin 0 -> 4215 bytes .../sindh/sardar_ali_shah-134.jpg | Bin 0 -> 3907 bytes .../sindh/sarfraz_hussain_shah-135.jpg | Bin 0 -> 3074 bytes .../sindh/seema_khurram-136.jpg | Bin 0 -> 3741 bytes .../sindh/shabbir_ali_khan-137.jpg | Bin 0 -> 2792 bytes .../sindh/shah_hussain_shah_sheerazi-138.jpg | Bin 0 -> 3827 bytes public/representatives/sindh/shaheena-139.jpg | Bin 0 -> 3741 bytes .../sindh/shahid_thahim-140.jpg | Bin 0 -> 3224 bytes .../representatives/sindh/sham_sunder-141.jpg | Bin 0 -> 3023 bytes .../sindh/shariq_jamal-142.jpg | Bin 0 -> 3525 bytes .../representatives/sindh/shazia_umar-143.jpg | Bin 0 -> 3590 bytes .../sindh/sheikh_abdullah-144.jpg | Bin 0 -> 4117 bytes .../sindh/sher_muhammad_mugheri-145.jpg | Bin 0 -> 2879 bytes .../sindh/sherjeel_inam-146.jpg | Bin 0 -> 3479 bytes .../sindh/shiraz_shaukat_rajper-147.jpg | Bin 0 -> 4105 bytes .../representatives/sindh/shoukat_ali-148.jpg | Bin 0 -> 3545 bytes .../sindh/sikandar_ali_shoro-149.jpg | Bin 0 -> 3376 bytes .../sindh/sikandar_khatoon-150.jpg | Bin 0 -> 4069 bytes .../sindh/sohail_anwar_siyal-151.jpg | Bin 0 -> 4285 bytes .../sindh/sohrab_khan_sarki-152.jpg | Bin 0 -> 12370 bytes .../sindh/sumeta_afzal_syed-153.jpg | Bin 0 -> 3561 bytes .../sindh/syed_saleh_shah_jilani-154.jpg | Bin 0 -> 2924 bytes .../sindh/syeda_marvi_faseeh-155.jpg | Bin 0 -> 8294 bytes .../sindh/taha_ahmed_khan-156.jpg | Bin 0 -> 2709 bytes .../sindh/taj_muhammad_mallah-157.jpg | Bin 0 -> 3624 bytes .../sindh/tanzila_umi_habiba-158.jpg | Bin 0 -> 6591 bytes .../sindh/tarique_ali_talpur-159.jpg | Bin 0 -> 2632 bytes .../sindh/wajid_hussain_khan-160.jpg | Bin 0 -> 3911 bytes .../sindh/zia_abbas_shah-161.jpg | Bin 0 -> 3529 bytes .../sindh/zia_ul_hassan-162.jpg | Bin 0 -> 4155 bytes .../sindh/zubair_ahmed_junejo-163.jpg | Bin 0 -> 3242 bytes .../backfill-national.ts | 62 ++ scripts/provincial-assemblies/copy-images.ts | 115 +++ .../extract-balochistan.ts | 111 ++ scripts/provincial-assemblies/extract-kp.ts | 119 +++ .../provincial-assemblies/extract-sindh.ts | 105 ++ .../provincial-assemblies/lib/match-image.ts | 68 ++ .../lib/party-normalize.ts | 107 ++ scripts/provincial-assemblies/lib/pdf.ts | 45 + scripts/provincial-assemblies/lib/slugify.ts | 37 + scripts/provincial-assemblies/lib/types.ts | 41 + scripts/provincial-assemblies/seed.ts | 136 +++ tailwind.config.js | 1 + tsconfig.tsbuildinfo | 2 +- 425 files changed, 5840 insertions(+), 34 deletions(-) create mode 100644 app/[locale]/about/page.tsx create mode 100644 app/[locale]/admin/dashboard/page.tsx create mode 100644 app/[locale]/admin/upload/page.tsx create mode 100644 app/[locale]/auth/callback/page.tsx create mode 100644 app/[locale]/bills/[id]/loading.tsx create mode 100644 app/[locale]/bills/[id]/page.tsx create mode 100644 app/[locale]/bills/page.tsx create mode 100644 app/[locale]/chat.backup/page.tsx create mode 100644 app/[locale]/chat/page.tsx create mode 100644 app/[locale]/components/message-threads-sidebar.tsx create mode 100644 app/[locale]/constitution/page.tsx create mode 100644 app/[locale]/layout.tsx create mode 100644 app/[locale]/page.tsx create mode 100644 app/[locale]/proceedings/[id]/loading.tsx create mode 100644 app/[locale]/proceedings/[id]/page.tsx create mode 100644 app/[locale]/proceedings/page.tsx create mode 100644 app/[locale]/representatives/[id]/page.tsx create mode 100644 app/[locale]/representatives/page.tsx create mode 100644 components/language-switcher.tsx create mode 100644 i18n/navigation.ts create mode 100644 i18n/request.ts create mode 100644 i18n/routing.ts create mode 100644 lib/assemblies.ts create mode 100644 lib/db/migrations/0006_groovy_peter_parker.sql create mode 100644 lib/db/migrations/meta/0006_snapshot.json create mode 100644 lib/representative-image.ts create mode 100644 messages/en.json create mode 100644 messages/ur.json create mode 100644 middleware.ts create mode 100644 public/representatives/balochistan/abdul_khaliq_khan_achakzai-51.jpg create mode 100644 public/representatives/balochistan/abdul_majeed_badini-16.jpg create mode 100644 public/representatives/balochistan/abdul_malik_baloch-26.jpg create mode 100644 public/representatives/balochistan/ali_hasan_zehri-21.jpg create mode 100644 public/representatives/balochistan/ali_madad_jattak-45.jpg create mode 100644 public/representatives/balochistan/asfand_yar_khan_kakar-47.jpg create mode 100644 public/representatives/balochistan/asghar_ali_tareen-48.jpg create mode 100644 public/representatives/balochistan/ashok_kumar-65.jpg create mode 100644 public/representatives/balochistan/bakht_muhammad-39.jpg create mode 100644 public/representatives/balochistan/barkat_ali_rind-27.jpg create mode 100644 public/representatives/balochistan/farah_azeem_shah-54.jpg create mode 100644 public/representatives/balochistan/fazal_qadir-2.jpg create mode 100644 public/representatives/balochistan/ghazala_gola_begum-52.jpg create mode 100644 public/representatives/balochistan/hadiya_nawaz-57.jpg create mode 100644 public/representatives/balochistan/khair_jan_baloch-23.jpg create mode 100644 public/representatives/balochistan/malik_naeem_khan_bazai-38.jpg create mode 100644 public/representatives/balochistan/meena_majeed-64.jpg create mode 100644 public/representatives/balochistan/mir_asadullah_baloch-29.jpg create mode 100644 public/representatives/balochistan/mir_ghulam_dastagir_badeni-34.jpg create mode 100644 public/representatives/balochistan/mir_jehanzaib_mengal-20.jpg create mode 100644 public/representatives/balochistan/mir_liaqat_ali_lehri-43.jpg create mode 100644 public/representatives/balochistan/mir_mohammad_asim_kurd_gello-12.jpg create mode 100644 public/representatives/balochistan/mir_muhammad_asghar_rind-28.jpg create mode 100644 public/representatives/balochistan/mir_muhammad_sadiq_umrani-13.jpg create mode 100644 public/representatives/balochistan/mir_samad_khan_gorgage-40.jpg create mode 100644 public/representatives/balochistan/mir_sarfraz_ahmed_bugti-10.jpg create mode 100644 public/representatives/balochistan/mir_shoaib_nusherwani-33.jpg create mode 100644 public/representatives/balochistan/mir_ubaidullah_gorgage-44.jpg create mode 100644 public/representatives/balochistan/mir_younas_aziz_zehri-19.jpg create mode 100644 public/representatives/balochistan/mir_zabid_ali_reki-31.jpg create mode 100644 public/representatives/balochistan/mir_zafarullah_khan_zehri-35.jpg create mode 100644 public/representatives/balochistan/mir_zahoor_ahmed_buledi-25.jpg create mode 100644 public/representatives/balochistan/mir_zia_ullah_langov-36.jpg create mode 100644 public/representatives/balochistan/molvi_noorullah-3.jpg create mode 100644 public/representatives/balochistan/moulana_hidayat_ur_rehman_baloch-24.jpg create mode 100644 public/representatives/balochistan/muhammad_khan_lehri-14.jpg create mode 100644 public/representatives/balochistan/muhammad_khan_toor-5.jpg create mode 100644 public/representatives/balochistan/muhammad_nawaz-1.jpg create mode 100644 public/representatives/balochistan/muhammad_sadiq_sanjrani-32.jpg create mode 100644 public/representatives/balochistan/nawab_jangayz_khan_marri-9.jpg create mode 100644 public/representatives/balochistan/nawab_muhammad_aslam_khan_raisani-37.jpg create mode 100644 public/representatives/balochistan/nawab_sanaullah_zehri-18.jpg create mode 100644 public/representatives/balochistan/nawabzada_muhammad_zarain_khan_magsi-22.jpg create mode 100644 public/representatives/balochistan/nawabzada_tariq_magsi-11.jpg create mode 100644 public/representatives/balochistan/noor_muhammad_dummar-7.jpg create mode 100644 public/representatives/balochistan/prince_ahmed_omar_ahmedzai-46.jpg create mode 100644 public/representatives/balochistan/raheela_hameed_khan_durrani-55.jpg create mode 100644 public/representatives/balochistan/ravi_pahuja-53.jpg create mode 100644 public/representatives/balochistan/rehmat_saleh_baloch-30.jpg create mode 100644 public/representatives/balochistan/rubaba_khan_buledi-58.jpg create mode 100644 public/representatives/balochistan/safia_fazlur_rehman-60.jpg create mode 100644 public/representatives/balochistan/saleem_ahmed-15.jpg create mode 100644 public/representatives/balochistan/salma_bibi-62.jpg create mode 100644 public/representatives/balochistan/sanjay_kumar-63.jpg create mode 100644 public/representatives/balochistan/sardar_abdul_rehman_kehtran-4.jpg create mode 100644 public/representatives/balochistan/sardar_masood_ali_khan_luni-6.jpg create mode 100644 public/representatives/balochistan/sardar_mir_kohyar_khan_domki-8.jpg create mode 100644 public/representatives/balochistan/sardarzada_faisal_khan_jamali-17.jpg create mode 100644 public/representatives/balochistan/shahida_rauf-59.jpg create mode 100644 public/representatives/balochistan/shehnaz_umrani-56.jpg create mode 100644 public/representatives/balochistan/syed_zafar_ali_agha-49.jpg create mode 100644 public/representatives/balochistan/ume_kalsoom-61.jpg create mode 100644 public/representatives/balochistan/wali_muhammad_noorzai-41.jpg create mode 100644 public/representatives/balochistan/zamarak_khan-50.jpg create mode 100644 public/representatives/balochistan/zarak_khan-42.jpg create mode 100644 public/representatives/kp/abdul_ghani-71.jpg create mode 100644 public/representatives/kp/abdul_kabir_khan-27.jpg create mode 100644 public/representatives/kp/abdul_karim_khan-51.jpg create mode 100644 public/representatives/kp/abdul_munim-29.jpg create mode 100644 public/representatives/kp/adnan_khan-101.jpg create mode 100644 public/representatives/kp/afshan_hussain-130.jpg create mode 100644 public/representatives/kp/aftab_alam-90.jpg create mode 100644 public/representatives/kp/ahmad_kundi-112.jpg create mode 100644 public/representatives/kp/aiman_jalil_jan-122.jpg create mode 100644 public/representatives/kp/ajab_gul-110.jpg create mode 100644 public/representatives/kp/ajmal_khan-21.jpg create mode 100644 public/representatives/kp/akbar_ayub_khan-46.jpg create mode 100644 public/representatives/kp/akhtar_khan-5.jpg create mode 100644 public/representatives/kp/akram_khan_durrani-102.jpg create mode 100644 public/representatives/kp/ali_amin_gandapur-113.jpg create mode 100644 public/representatives/kp/ali_hadi-96.jpg create mode 100644 public/representatives/kp/ali_shah-4.jpg create mode 100644 public/representatives/kp/amina_sardar-128.jpg create mode 100644 public/representatives/kp/amir_farzand_khan-56.jpg create mode 100644 public/representatives/kp/amjad_ali-7.jpg create mode 100644 public/representatives/kp/anwar_zeb_khan-20.jpg create mode 100644 public/representatives/kp/aqib_ullah_khan-50.jpg create mode 100644 public/representatives/kp/arbab_muhammad_usman_khan-75.jpg create mode 100644 public/representatives/kp/arbab_muhammad_waseem_khan-73.jpg create mode 100644 public/representatives/kp/arbab_zarak_khan-80.jpg create mode 100644 public/representatives/kp/arifa_bibi-127.jpg create mode 100644 public/representatives/kp/arshad_ali-63.jpg create mode 100644 public/representatives/kp/arshad_ayub_khan-47.jpg create mode 100644 public/representatives/kp/ashbar_jan_jadoon-137.jpg create mode 100644 public/representatives/kp/asif_khan-109.jpg create mode 100644 public/representatives/kp/asker_pervaiz-142.jpg create mode 100644 public/representatives/kp/asma_alam-117.jpg create mode 100644 public/representatives/kp/aurangzeb_khan-94.jpg create mode 100644 public/representatives/kp/babar_saleem_swati-37.jpg create mode 100644 public/representatives/kp/beari_lal-145.jpg create mode 100644 public/representatives/kp/daud_shah-91.jpg create mode 100644 public/representatives/kp/ehsan_ullah_khan-115.jpg create mode 100644 public/representatives/kp/faisal_khan_tarakai-52.jpg create mode 100644 public/representatives/kp/faiza_malik-129.jpg create mode 100644 public/representatives/kp/farah_khan-133.jpg create mode 100644 public/representatives/kp/farzana_shereen-138.jpg create mode 100644 public/representatives/kp/fateh_ul_mulk_ali_nasir-2.jpg create mode 100644 public/representatives/kp/fazal_elahi-84.jpg create mode 100644 public/representatives/kp/fazal_hakeem_khan-6.jpg create mode 100644 public/representatives/kp/fazal_haq-31.jpg create mode 100644 public/representatives/kp/fazal_shakoor_khan-65.jpg create mode 100644 public/representatives/kp/gul_ibrahim_khan-11.jpg create mode 100644 public/representatives/kp/gurpal_singh-143.jpg create mode 100644 public/representatives/kp/hamid_ur_rahman-8.jpg create mode 100644 public/representatives/kp/hamid_ur_rehman-19.jpg create mode 100644 public/representatives/kp/hisham_inam_ullah_khan-106.jpg create mode 100644 public/representatives/kp/humayun_khan-15.jpg create mode 100644 public/representatives/kp/ibadullah_khan-30.jpg create mode 100644 public/representatives/kp/iftikhar_ali_mashwani-60.jpg create mode 100644 public/representatives/kp/iftikhar_jadoon-44.jpg create mode 100644 public/representatives/kp/iftikhar_ullah_jan-64.jpg create mode 100644 public/representatives/kp/ihtisham_ali-61.jpg create mode 100644 public/representatives/kp/ijaz_muhammad-74.jpg create mode 100644 public/representatives/kp/ikram_ullah-39.jpg create mode 100644 public/representatives/kp/ishfaq_ahmad-89.jpg create mode 100644 public/representatives/kp/jalal_khan-79.jpg create mode 100644 public/representatives/kp/jamila_paracha-132.jpg create mode 100644 public/representatives/kp/johar_muhammad-105.jpg create mode 100644 public/representatives/kp/khadija_bibi-140.jpg create mode 100644 public/representatives/kp/khaleeq_ur_rehman-87.jpg create mode 100644 public/representatives/kp/khalid_khan-62.jpg create mode 100644 public/representatives/kp/kiramat_ullah_khan-72.jpg create mode 100644 public/representatives/kp/laiq_muhammad_khan-41.jpg create mode 100644 public/representatives/kp/liaqat_ali_khan-18.jpg create mode 100644 public/representatives/kp/lutf_ur_rahman-114.jpg create mode 100644 public/representatives/kp/madina_gul_afridi-123.jpg create mode 100644 public/representatives/kp/mahboob_sher-67.jpg create mode 100644 public/representatives/kp/makhdoom_zada_muhammad_aftab_haider-111.jpg create mode 100644 public/representatives/kp/malik_adeel_lqbal-48.jpg create mode 100644 public/representatives/kp/malik_tariq_awan-82.jpg create mode 100644 public/representatives/kp/meena_khan-83.jpg create mode 100644 public/representatives/kp/meher_sultana-136.jpg create mode 100644 public/representatives/kp/mian_muhammad_umar-88.jpg create mode 100644 public/representatives/kp/muhammad_abdul_salam-58.jpg create mode 100644 public/representatives/kp/muhammad_adnan_qadri-69.jpg create mode 100644 public/representatives/kp/muhammad_anwar_khan-13.jpg create mode 100644 public/representatives/kp/muhammad_arif-66.jpg create mode 100644 public/representatives/kp/muhammad_azam_khan-14.jpg create mode 100644 public/representatives/kp/muhammad_idrees-86.jpg create mode 100644 public/representatives/kp/muhammad_iqbal_khan-103.jpg create mode 100644 public/representatives/kp/muhammad_israr-68.jpg create mode 100644 public/representatives/kp/muhammad_khursheed-97.jpg create mode 100644 public/representatives/kp/muhammad_naeem-10.jpg create mode 100644 public/representatives/kp/muhammad_nisar_baaz-22.jpg create mode 100644 public/representatives/kp/muhammad_rashad_khan-28.jpg create mode 100644 public/representatives/kp/muhammad_riaz-33.jpg create mode 100644 public/representatives/kp/muhammad_sajjad-98.jpg create mode 100644 public/representatives/kp/muhammad_sohail_afridi-70.jpg create mode 100644 public/representatives/kp/muhammad_usman-108.jpg create mode 100644 public/representatives/kp/muhammad_yamin-12.jpg create mode 100644 public/representatives/kp/muhammad_zahir_shah-57.jpg create mode 100644 public/representatives/kp/munir_hussain-36.jpg create mode 100644 public/representatives/kp/murtaza_khan_tarakai-53.jpg create mode 100644 public/representatives/kp/musavir_khan-24.jpg create mode 100644 public/representatives/kp/mushtaq_ahmed_ghani-45.jpg create mode 100644 public/representatives/kp/nadia_sher-139.jpg create mode 100644 public/representatives/kp/naheeda_noor-126.jpg create mode 100644 public/representatives/kp/nazir_ahmed_abbasi-42.jpg create mode 100644 public/representatives/kp/neelofar_babar-120.jpg create mode 100644 public/representatives/kp/neelofer_begum-125.jpg create mode 100644 public/representatives/kp/nek_muhammad_khan-104.jpg create mode 100644 public/representatives/kp/pakhtoon_yar_khan-100.jpg create mode 100644 public/representatives/kp/rajab_ali_khan_abbasi-43.jpg create mode 100644 public/representatives/kp/rangez_ahmad-49.jpg create mode 100644 public/representatives/kp/rehana_ismail-116.jpg create mode 100644 public/representatives/kp/riaz_khan-25.jpg create mode 100644 public/representatives/kp/sajjad_ullah-32.jpg create mode 100644 public/representatives/kp/sami_ullah_khan-76.jpg create mode 100644 public/representatives/kp/sardar_shahjehan_yousaf-40.jpg create mode 100644 public/representatives/kp/shafi_ullah-16.jpg create mode 100644 public/representatives/kp/shafi_ullah_jan-92.jpg create mode 100644 public/representatives/kp/shah_abu_turab_khan_bangash-93.jpg create mode 100644 public/representatives/kp/shahida-141.jpg create mode 100644 public/representatives/kp/shakeel_ahmed-23.jpg create mode 100644 public/representatives/kp/sharafat_ali-3.jpg create mode 100644 public/representatives/kp/shazia_jadoon-131.jpg create mode 100644 public/representatives/kp/shazia_tehmas_khan-135.jpg create mode 100644 public/representatives/kp/shehla_bano-119.jpg create mode 100644 public/representatives/kp/sher_ali_afridi-77.jpg create mode 100644 public/representatives/kp/sobia_shahid-118.jpg create mode 100644 public/representatives/kp/sultan_room-9.jpg create mode 100644 public/representatives/kp/suresh_kumar-144.jpg create mode 100644 public/representatives/kp/suriya_bibi-1.jpg create mode 100644 public/representatives/kp/syed_fakhar_jehan-26.jpg create mode 100644 public/representatives/kp/syed_qasim_ali_shah-81.jpg create mode 100644 public/representatives/kp/syeda_sonia_hussain-134.jpg create mode 100644 public/representatives/kp/taj_muhammad-35.jpg create mode 100644 public/representatives/kp/tariq_mehmood_aryani-59.jpg create mode 100644 public/representatives/kp/tariq_saeed-107.jpg create mode 100644 public/representatives/kp/tufail_anjum-55.jpg create mode 100644 public/representatives/kp/ubaidur_rahman-17.jpg create mode 100644 public/representatives/kp/zahid_chanzeb-38.jpg create mode 100644 public/representatives/kp/zahid_ullah_khan-99.jpg create mode 100644 public/representatives/kp/zahir_khan-78.jpg create mode 100644 public/representatives/kp/zar_alam_khan-85.jpg create mode 100644 public/representatives/kp/zarshad_khan-54.jpg create mode 100644 public/representatives/kp/zubair_khan-34.jpg create mode 100644 public/representatives/sindh/abdul_basit-1.jpg create mode 100644 public/representatives/sindh/abdul_rauf_khoso-2.jpg create mode 100644 public/representatives/sindh/abdul_razaq_raja-3.jpg create mode 100644 public/representatives/sindh/abdul_waseem-4.jpg create mode 100644 public/representatives/sindh/adil_altaf_unar-5.jpg create mode 100644 public/representatives/sindh/adil_askari-6.jpg create mode 100644 public/representatives/sindh/agha_shahbaz_ali_durrani-7.jpg create mode 100644 public/representatives/sindh/aijaz_hussain_shah-8.jpg create mode 100644 public/representatives/sindh/ajaz_khan-9.jpg create mode 100644 public/representatives/sindh/ali_ahmed-10.jpg create mode 100644 public/representatives/sindh/ali_hassan-11.jpg create mode 100644 public/representatives/sindh/ali_hassan-12.jpg create mode 100644 public/representatives/sindh/ali_khurshidi-13.jpg create mode 100644 public/representatives/sindh/ali_nawaz_khan_mahar-14.jpg create mode 100644 public/representatives/sindh/allah_bux_talpur-15.jpg create mode 100644 public/representatives/sindh/ameer_ali_shah-16.jpg create mode 100644 public/representatives/sindh/aneel_kumar-17.jpg create mode 100644 public/representatives/sindh/anthony_naveed-18.jpg create mode 100644 public/representatives/sindh/arbab_amir_amanullah-19.jpg create mode 100644 public/representatives/sindh/arbab_lutfullah-20.jpg create mode 100644 public/representatives/sindh/arooba_rabbani-21.jpg create mode 100644 public/representatives/sindh/arsalan_perwaiz-22.jpg create mode 100644 public/representatives/sindh/awais_qadir_shah-23.jpg create mode 100644 public/representatives/sindh/azra_fazal_pechuho-24.jpg create mode 100644 public/representatives/sindh/bahadur_khan_dahri-25.jpg create mode 100644 public/representatives/sindh/bibi_yasmeen_shah-26.jpg create mode 100644 public/representatives/sindh/bilal_hussain_khan_jadoon-27.jpg create mode 100644 public/representatives/sindh/bilqees_mukhtar-28.jpg create mode 100644 public/representatives/sindh/dost_muhammad-29.jpg create mode 100644 public/representatives/sindh/ejaz_ul_haque-30.jpg create mode 100644 public/representatives/sindh/fahim_ahmed-31.jpg create mode 100644 public/representatives/sindh/faisal_rafiq-32.jpg create mode 100644 public/representatives/sindh/fakhar_zaman-33.jpg create mode 100644 public/representatives/sindh/faqeer_sher_muhammad_bilalani-34.jpg create mode 100644 public/representatives/sindh/farah_sohail-35.jpg create mode 100644 public/representatives/sindh/farhan_ansari-36.jpg create mode 100644 public/representatives/sindh/farukh_ahmed_shah-37.jpg create mode 100644 public/representatives/sindh/faryal_talpur-38.jpg create mode 100644 public/representatives/sindh/farzana_hanif-39.jpg create mode 100644 public/representatives/sindh/fayaz_ali_butt-40.jpg create mode 100644 public/representatives/sindh/fouzia_hameed-41.jpg create mode 100644 public/representatives/sindh/ghulam_abid-42.jpg create mode 100644 public/representatives/sindh/ghulam_qadir_chandio-43.jpg create mode 100644 public/representatives/sindh/giyanoo_mal-44.jpg create mode 100644 public/representatives/sindh/hallar_wassan-45.jpg create mode 100644 public/representatives/sindh/hari_ram-46.jpg create mode 100644 public/representatives/sindh/hassan_ali_shah-47.jpg create mode 100644 public/representatives/sindh/heer_soho-48.jpg create mode 100644 public/representatives/sindh/hina_dastagir-49.jpg create mode 100644 public/representatives/sindh/ikramullah_khan_dharejo-50.jpg create mode 100644 public/representatives/sindh/imdad_ali_pitafi-51.jpg create mode 100644 public/representatives/sindh/imtiaz_ahmed_shaikh-52.jpg create mode 100644 public/representatives/sindh/jam_khan_shoro-53.jpg create mode 100644 public/representatives/sindh/jamal_ahmed-54.jpg create mode 100644 public/representatives/sindh/jameel_ahmed-55.jpg create mode 100644 public/representatives/sindh/javed_iqbal-56.jpg create mode 100644 public/representatives/sindh/khairunisa-57.jpg create mode 100644 public/representatives/sindh/khan_chandio-58.jpg create mode 100644 public/representatives/sindh/khatumal_jeewan-59.jpg create mode 100644 public/representatives/sindh/khurram_karim_soomro-60.jpg create mode 100644 public/representatives/sindh/kiran_masood-61.jpg create mode 100644 public/representatives/sindh/liaquat_ali_askani-62.jpg create mode 100644 public/representatives/sindh/mahesh_kumar_hasija-63.jpg create mode 100644 public/representatives/sindh/mahmood_alam_jamot-64.jpg create mode 100644 public/representatives/sindh/mahtab_hussain_dahar-65.jpg create mode 100644 public/representatives/sindh/maleeha_manzoor-66.jpg create mode 100644 public/representatives/sindh/malik_sikander_khan-67.jpg create mode 100644 public/representatives/sindh/mehboob_ali_khan_bijarani-68.jpg create mode 100644 public/representatives/sindh/mehboob_zaman-69.jpg create mode 100644 public/representatives/sindh/moid_anver-70.jpg create mode 100644 public/representatives/sindh/muhammad_aamir_siddiqui-71.jpg create mode 100644 public/representatives/sindh/muhammad_ali_malkani-72.jpg create mode 100644 public/representatives/sindh/muhammad_arif_khan_mahar-73.jpg create mode 100644 public/representatives/sindh/muhammad_asif-74.jpg create mode 100644 public/representatives/sindh/muhammad_asif_khan-75.jpg create mode 100644 public/representatives/sindh/muhammad_bux_khan_mahar-76.jpg create mode 100644 public/representatives/sindh/muhammad_daniyal-77.jpg create mode 100644 public/representatives/sindh/muhammad_dilawar-78.jpg create mode 100644 public/representatives/sindh/muhammad_farooq-79.jpg create mode 100644 public/representatives/sindh/muhammad_farooq_awan-80.jpg create mode 100644 public/representatives/sindh/muhammad_halepota-81.jpg create mode 100644 public/representatives/sindh/muhammad_iftikhar_alam-82.jpg create mode 100644 public/representatives/sindh/muhammad_ismail_rahoo-83.jpg create mode 100644 public/representatives/sindh/muhammad_maaz_mehboob-84.jpg create mode 100644 public/representatives/sindh/muhammad_mazahir_amir-85.jpg create mode 100644 public/representatives/sindh/muhammad_owais-86.jpg create mode 100644 public/representatives/sindh/muhammad_qasim-87.jpg create mode 100644 public/representatives/sindh/muhammad_rashid_khan-88.jpg create mode 100644 public/representatives/sindh/muhammad_rehan_rajput-89.jpg create mode 100644 public/representatives/sindh/muhammad_sajid-90.jpg create mode 100644 public/representatives/sindh/muhammad_saleem-91.jpg create mode 100644 public/representatives/sindh/muhammad_shabbir_qureshi-92.jpg create mode 100644 public/representatives/sindh/muhammad_taimur_talpur-93.jpg create mode 100644 public/representatives/sindh/muhammad_usman-94.jpg create mode 100644 public/representatives/sindh/muhammad_yousuf-95.jpg create mode 100644 public/representatives/sindh/muhammad_yousuf_baloch-96.jpg create mode 100644 public/representatives/sindh/mujeeb_ul_haq-97.jpg create mode 100644 public/representatives/sindh/mukesh_kumar_chawla-98.jpg create mode 100644 public/representatives/sindh/mumtaz_ali_chandio-99.jpg create mode 100644 public/representatives/sindh/mumtaz_hussain_khan-100.jpg create mode 100644 public/representatives/sindh/murad_ali_shah-101.jpg create mode 100644 public/representatives/sindh/musarrat_jabeen-102.jpg create mode 100644 public/representatives/sindh/nadir_akmal_khan_leghari-103.jpg create mode 100644 public/representatives/sindh/nadir_ali_magsi-104.jpg create mode 100644 public/representatives/sindh/naeem_ahmed_kharal-105.jpg create mode 100644 public/representatives/sindh/najam_mirza-106.jpg create mode 100644 public/representatives/sindh/naseer_ahmed-107.jpg create mode 100644 public/representatives/sindh/nasir_hussain_qureshi-108.jpg create mode 100644 public/representatives/sindh/nasir_hussain_shah_rizvi-109.jpg create mode 100644 public/representatives/sindh/nawabzada_burhan_chandio-110.jpg create mode 100644 public/representatives/sindh/nida_khuhro-111.jpg create mode 100644 public/representatives/sindh/nisar_ahmed_khuhro-112.jpg create mode 100644 public/representatives/sindh/noor_ahmed_bhurgri-113.jpg create mode 100644 public/representatives/sindh/nuhzat_pathan-114.jpg create mode 100644 public/representatives/sindh/paras_dero-115.jpg create mode 100644 public/representatives/sindh/qaim_ali_shah-116.jpg create mode 100644 public/representatives/sindh/qurat_ul_ain_khan-117.jpg create mode 100644 public/representatives/sindh/rana_hamir_singh-118.jpg create mode 100644 public/representatives/sindh/rehan_akram-119.jpg create mode 100644 public/representatives/sindh/rehan_bandukda-120.jpg create mode 100644 public/representatives/sindh/rehana_laghari-121.jpg create mode 100644 public/representatives/sindh/riaz_hussain_shah_sheerazi-122.jpg create mode 100644 public/representatives/sindh/rooma_sabahat-123.jpg create mode 100644 public/representatives/sindh/rukhsana_perveen-124.jpg create mode 100644 public/representatives/sindh/sabir_hussain_kaimkhani-125.jpg create mode 100644 public/representatives/sindh/sadhumal_surendar_valasai-126.jpg create mode 100644 public/representatives/sindh/sadia_javed-127.jpg create mode 100644 public/representatives/sindh/saeed_ghani-128.jpg create mode 100644 public/representatives/sindh/saima_agha-129.jpg create mode 100644 public/representatives/sindh/sajeela-130.jpg create mode 100644 public/representatives/sindh/sajid_ali_banbhan-131.jpg create mode 100644 public/representatives/sindh/sajid_hussain-132.jpg create mode 100644 public/representatives/sindh/sajjad_ali_soomro-133.jpg create mode 100644 public/representatives/sindh/sardar_ali_shah-134.jpg create mode 100644 public/representatives/sindh/sarfraz_hussain_shah-135.jpg create mode 100644 public/representatives/sindh/seema_khurram-136.jpg create mode 100644 public/representatives/sindh/shabbir_ali_khan-137.jpg create mode 100644 public/representatives/sindh/shah_hussain_shah_sheerazi-138.jpg create mode 100644 public/representatives/sindh/shaheena-139.jpg create mode 100644 public/representatives/sindh/shahid_thahim-140.jpg create mode 100644 public/representatives/sindh/sham_sunder-141.jpg create mode 100644 public/representatives/sindh/shariq_jamal-142.jpg create mode 100644 public/representatives/sindh/shazia_umar-143.jpg create mode 100644 public/representatives/sindh/sheikh_abdullah-144.jpg create mode 100644 public/representatives/sindh/sher_muhammad_mugheri-145.jpg create mode 100644 public/representatives/sindh/sherjeel_inam-146.jpg create mode 100644 public/representatives/sindh/shiraz_shaukat_rajper-147.jpg create mode 100644 public/representatives/sindh/shoukat_ali-148.jpg create mode 100644 public/representatives/sindh/sikandar_ali_shoro-149.jpg create mode 100644 public/representatives/sindh/sikandar_khatoon-150.jpg create mode 100644 public/representatives/sindh/sohail_anwar_siyal-151.jpg create mode 100644 public/representatives/sindh/sohrab_khan_sarki-152.jpg create mode 100644 public/representatives/sindh/sumeta_afzal_syed-153.jpg create mode 100644 public/representatives/sindh/syed_saleh_shah_jilani-154.jpg create mode 100644 public/representatives/sindh/syeda_marvi_faseeh-155.jpg create mode 100644 public/representatives/sindh/taha_ahmed_khan-156.jpg create mode 100644 public/representatives/sindh/taj_muhammad_mallah-157.jpg create mode 100644 public/representatives/sindh/tanzila_umi_habiba-158.jpg create mode 100644 public/representatives/sindh/tarique_ali_talpur-159.jpg create mode 100644 public/representatives/sindh/wajid_hussain_khan-160.jpg create mode 100644 public/representatives/sindh/zia_abbas_shah-161.jpg create mode 100644 public/representatives/sindh/zia_ul_hassan-162.jpg create mode 100644 public/representatives/sindh/zubair_ahmed_junejo-163.jpg create mode 100644 scripts/provincial-assemblies/backfill-national.ts create mode 100644 scripts/provincial-assemblies/copy-images.ts create mode 100644 scripts/provincial-assemblies/extract-balochistan.ts create mode 100644 scripts/provincial-assemblies/extract-kp.ts create mode 100644 scripts/provincial-assemblies/extract-sindh.ts create mode 100644 scripts/provincial-assemblies/lib/match-image.ts create mode 100644 scripts/provincial-assemblies/lib/party-normalize.ts create mode 100644 scripts/provincial-assemblies/lib/pdf.ts create mode 100644 scripts/provincial-assemblies/lib/slugify.ts create mode 100644 scripts/provincial-assemblies/lib/types.ts create mode 100644 scripts/provincial-assemblies/seed.ts diff --git a/app/[locale]/about/page.tsx b/app/[locale]/about/page.tsx new file mode 100644 index 0000000..605f3c1 --- /dev/null +++ b/app/[locale]/about/page.tsx @@ -0,0 +1,171 @@ +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card" +import { Button } from "@/components/ui/button" +import { ExternalLink } from "lucide-react" +import { useTranslations } from 'next-intl' + +export default function AboutPage() { + const t = useTranslations('About') + + return ( +
+ {/* Hero Section */} +
+
+ Pakistan Parliament +
+
+
+

+ {t('title')} +

+

+ {t('subtitle')} +

+
+
+ + {/* Journey Section */} +
+ + + {t('originalVision')} + + +

+ {t('originalVisionDesc')} +

+
+
+ + + + {t('pivot')} + + +

+ {t('pivotDesc')} +

+
+
+ + + + {t('today')} + + +

+ {t('todayDesc')} +

+
+
+
+ + {/* Featured Article */} + + + {t('mediaTitle')} + + + Code for Pakistan Logo +
+

{t('mediaArticleTitle')}

+

+ {t('mediaArticleDesc')} +

+ +
+
+
+ + {/* Key Features */} +
+

{t('featuresTitle')}

+
+ + + {t('features.representativesTitle')} + + +

+ {t('features.representativesDesc')} +

+
+
+ + + + {t('features.locationTitle')} + + +

+ {t('features.locationDesc')} +

+
+
+ + + + {t('features.chatTitle')} + + +

+ {t('features.chatDesc')} +

+
+
+ + + + {t('features.availableTitle')} + + +

+ {t('features.availableDesc')} +

+
+
+ + + + {t('features.searchTitle')} + + +

+ {t('features.searchDesc')} +

+
+
+ + + + {t('features.languageTitle')} + + +

+ {t('features.languageDesc')} +

+
+
+
+
+
+ ) +} diff --git a/app/[locale]/admin/dashboard/page.tsx b/app/[locale]/admin/dashboard/page.tsx new file mode 100644 index 0000000..5253151 --- /dev/null +++ b/app/[locale]/admin/dashboard/page.tsx @@ -0,0 +1,187 @@ +'use client'; + +import { useEffect, useState } from 'react'; +import { Button } from "@/components/ui/button"; +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import { Badge } from "@/components/ui/badge"; +import { Progress } from "@/components/ui/progress"; +import { Skeleton } from "@/components/ui/skeleton"; +import { formatDistanceToNow } from 'date-fns'; + +type UploadStatus = 'pending' | 'processing' | 'completed' | 'failed'; + +interface DocumentUpload { + id: string; + status: UploadStatus; + originalFileName: string; + fileSize: number; + uploadProgress: number; + processingProgress: number; + error: string | null; + createdAt: string; + updatedAt: string; +} + +export default function DashboardPage() { + const [uploads, setUploads] = useState([]); + const [loading, setLoading] = useState(false); + const [isAuthorized, setIsAuthorized] = useState(false); + const [password, setPassword] = useState(''); + const [error, setError] = useState(''); + + const checkPassword = async (inputPassword: string) => { + try { + const response = await fetch('/api/admin/check', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ password: inputPassword }), + }); + + if (response.ok) { + setIsAuthorized(true); + sessionStorage.setItem('adminAuthorized', 'true'); + fetchUploads(); + } else { + setError('Invalid password'); + } + } catch (error) { + setError('Something went wrong'); + } + }; + + const fetchUploads = async () => { + try { + setLoading(true); + const response = await fetch('/api/admin/uploads'); + const data = await response.json(); + setUploads(data); + } catch (error) { + console.error('Failed to fetch uploads:', error); + } finally { + setLoading(false); + } + }; + + useEffect(() => { + if (sessionStorage.getItem('adminAuthorized') === 'true') { + setIsAuthorized(true); + fetchUploads(); + } + }, []); + + if (!isAuthorized) { + return ( +
+

Admin Access

+
+
+ + setPassword(e.target.value)} + className="w-full rounded-md border border-input bg-background px-3 py-2" + /> +
+ + {error &&

{error}

} +
+
+ ); + } + + const getStatusBadge = (status: UploadStatus) => { + const variants = { + pending: 'secondary', + processing: 'default', + completed: 'success', + failed: 'destructive', + }; + + return ( + + {status.charAt(0).toUpperCase() + status.slice(1)} + + ); + }; + + const formatFileSize = (bytes: number) => { + if (bytes === 0) return '0 Bytes'; + const k = 1024; + const sizes = ['Bytes', 'KB', 'MB', 'GB']; + const i = Math.floor(Math.log(bytes) / Math.log(k)); + return parseFloat((bytes / Math.pow(k, i)).toFixed(2)) + ' ' + sizes[i]; + }; + + return ( +
+
+

Upload Dashboard

+ +
+ +
+ + + + File Name + Status + Size + Upload Progress + Processing Progress + Created + Error + + + + {loading ? ( + [...Array(5)].map((_, index) => ( + + + + + + + + + + )) + ) : ( + uploads.map((upload) => ( + + {upload.originalFileName} + {getStatusBadge(upload.status)} + {formatFileSize(upload.fileSize)} + + + + + + + + {formatDistanceToNow(new Date(upload.createdAt), { addSuffix: true })} + + + {upload.error || '-'} + + + )) + )} + +
+
+
+ ); +} \ No newline at end of file diff --git a/app/[locale]/admin/upload/page.tsx b/app/[locale]/admin/upload/page.tsx new file mode 100644 index 0000000..08a4b6b --- /dev/null +++ b/app/[locale]/admin/upload/page.tsx @@ -0,0 +1,225 @@ +'use client'; + +import { useState, useEffect } from 'react'; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from "@/components/ui/select"; +import { Progress } from "@/components/ui/progress"; +import { useRouter } from 'next/navigation'; + +export default function UploadPage() { + const router = useRouter(); + const [isAuthorized, setIsAuthorized] = useState(false); + const [password, setPassword] = useState(''); + const [error, setError] = useState(''); + const [loading, setLoading] = useState(false); + const [message, setMessage] = useState(''); + const [documentType, setDocumentType] = useState(''); + const [uploadProgress, setUploadProgress] = useState(0); + + const checkPassword = async (inputPassword: string) => { + try { + const response = await fetch('/api/admin/check', { + method: 'POST', + headers: { + 'Content-Type': 'application/json', + }, + body: JSON.stringify({ password: inputPassword }), + }); + + if (response.ok) { + setIsAuthorized(true); + sessionStorage.setItem('adminAuthorized', 'true'); + } else { + setError('Invalid password'); + } + } catch (error) { + setError('Something went wrong'); + } + }; + + useEffect(() => { + if (sessionStorage.getItem('adminAuthorized') === 'true') { + setIsAuthorized(true); + } + }, []); + + if (!isAuthorized) { + return ( +
+

Admin Access

+
+
+ + setPassword(e.target.value)} + /> +
+ + {error &&

{error}

} +
+
+ ); + } + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + setLoading(true); + setMessage(''); + setUploadProgress(0); + + const formData = new FormData(e.currentTarget); + const file = formData.get('file') as File; + + try { + // Create upload record + const uploadResponse = await fetch('/api/admin/uploads', { + method: 'POST', + body: formData, + }); + + if (!uploadResponse.ok) { + throw new Error('Failed to create upload record'); + } + + const upload = await uploadResponse.json(); + setMessage('Upload started. You can monitor progress in the dashboard.'); + + // Redirect to dashboard after a short delay + setTimeout(() => { + router.push('/admin/dashboard'); + }, 2000); + + } catch (error) { + setMessage('Error: ' + (error as Error).message); + setLoading(false); + } + }; + + return ( +
+
+

Upload Document

+ +
+ +
+
+ + +
+ +
+ + +
+ + {documentType === 'parliamentary_bulletin' && ( +
+ + +
+ )} + + {documentType === 'bill' && ( + <> +
+ + +
+
+ + +
+
+ + +
+
+ + +
+ + )} + +
+ + +
+ + {uploadProgress > 0 && ( +
+ + +
+ )} + + + + {message && ( +

+ {message} +

+ )} +
+
+ ); +} \ No newline at end of file diff --git a/app/[locale]/auth/callback/page.tsx b/app/[locale]/auth/callback/page.tsx new file mode 100644 index 0000000..0b55d87 --- /dev/null +++ b/app/[locale]/auth/callback/page.tsx @@ -0,0 +1,104 @@ +'use client' + +import { useEffect, useState } from 'react' +import { useRouter } from 'next/navigation' +import { useToast } from '@/hooks/use-toast' +import { trackPehchanLogin } from '@/lib/analytics' + +export default function AuthCallback() { + const router = useRouter() + const { toast } = useToast() + const [isProcessing, setIsProcessing] = useState(true) + + useEffect(() => { + const handleCallback = async () => { + try { + const params = new URLSearchParams(window.location.search) + console.log('Callback URL params:', Object.fromEntries(params.entries())) + + // Check for direct token response first (implicit flow) + const accessToken = params.get('access_token') + const idToken = params.get('id_token') + const error = params.get('error') + + console.log('Received params:', { + hasAccessToken: !!accessToken, + hasIdToken: !!idToken, + hasError: !!error + }) + + if (error) { + throw new Error(error) + } + + // Handle implicit flow (direct token response) + if (accessToken) { + localStorage.setItem('access_token', accessToken) + if (idToken) localStorage.setItem('id_token', idToken) + + // Dispatch custom event for same-tab updates + window.dispatchEvent(new Event('localStorageChange')) + + // Use our proxy endpoint instead + const userResponse = await fetch('/api/auth/userinfo', { + headers: { + 'Authorization': `Bearer ${accessToken}` + } + }) + + if (!userResponse.ok) { + throw new Error('Failed to fetch user info') + } + + const userInfo = await userResponse.json() + console.log('User info:', userInfo) + localStorage.setItem('user_info', JSON.stringify(userInfo)) + localStorage.setItem('pehchan_id', userInfo.profile.cnic) + + toast({ + title: "Login successful", + description: "Welcome to Numainda" + }) + + trackPehchanLogin(true) + router.push('/chat') + return + } + + // If we get here and don't have tokens, something went wrong + throw new Error( + `Authentication failed. ` + + `Received parameters: ${JSON.stringify(Object.fromEntries(params.entries()))}` + ) + + } catch (error) { + console.error('Auth callback error:', error) + trackPehchanLogin(false) + toast({ + variant: "destructive", + title: "Authentication Failed", + description: error instanceof Error ? error.message : "An error occurred during login" + }) + router.push('/chat') + } finally { + sessionStorage.removeItem('auth_state') + setIsProcessing(false) + } + } + + handleCallback() + }, [router, toast]) + + if (isProcessing) { + return ( +
+
+
+

Processing your login...

+
+
+ ) + } + + return null +} \ No newline at end of file diff --git a/app/[locale]/bills/[id]/loading.tsx b/app/[locale]/bills/[id]/loading.tsx new file mode 100644 index 0000000..b1e5741 --- /dev/null +++ b/app/[locale]/bills/[id]/loading.tsx @@ -0,0 +1,38 @@ +import { Skeleton } from "@/components/ui/skeleton" + +export default function BillDetailLoading() { + return ( +
+
+ {/* Title */} + + + {/* Status + Passage Date grid */} +
+
+ + +
+
+ + +
+
+ + {/* Summary section */} +
+ +
+ + + + + + + +
+
+
+
+ ) +} diff --git a/app/[locale]/bills/[id]/page.tsx b/app/[locale]/bills/[id]/page.tsx new file mode 100644 index 0000000..b12da4e --- /dev/null +++ b/app/[locale]/bills/[id]/page.tsx @@ -0,0 +1,68 @@ +import { db } from '@/lib/db'; +import { bills } from '@/lib/db/schema/bills'; +import { eq } from 'drizzle-orm'; +import { notFound } from 'next/navigation'; +import ReactMarkdown from 'react-markdown' +import { BillViewTracker } from '@/components/bill-view-tracker' +import { getTranslations } from 'next-intl/server'; + +export default async function BillPage({ params }: { params: { id: string } }) { + const t = await getTranslations('Bills'); + const [bill] = await db + .select() + .from(bills) + .where(eq(bills.id, params.id)); + + if (!bill) { + notFound(); + } + + const getStatusLabel = (status: string) => { + switch (status) { + case 'passed': return t('statusPassed'); + case 'rejected': return t('statusRejected'); + default: return t('statusPending'); + } + }; + + return ( +
+ +
+

{bill.title}

+
+ {/*
+

Bill Number

+

{bill.billNumber}

+
+
+

Session Number

+

{bill.sessionNumber}

+
*/} +
+

{t('status')}

+

+ {getStatusLabel(bill.status)} +

+
+ {bill.passageDate && ( +
+

{t('passageDate')}

+

+ {new Date(bill.passageDate).toLocaleDateString()} +

+
+ )} +
+
+

{t('summary')}

+
{bill.summary}
+
+
+
+ ); +} diff --git a/app/[locale]/bills/page.tsx b/app/[locale]/bills/page.tsx new file mode 100644 index 0000000..3529fdb --- /dev/null +++ b/app/[locale]/bills/page.tsx @@ -0,0 +1,173 @@ +'use client'; + +import { useState, useEffect } from 'react'; +import Link from 'next/link'; +import { Search } from 'lucide-react'; +import { Skeleton } from "@/components/ui/skeleton"; +import { Input } from "@/components/ui/input"; +import { Pagination } from "@/components/ui/pagination"; +import { useTranslations } from 'next-intl'; + +// Define the type for a bill +interface Bill { + id: string; + title: string; + status: string; + createdAt: string; + billNumber?: string; +} + +interface BillsResponse { + data: Bill[]; + pagination: { + page: number; + limit: number; + totalCount: number; + totalPages: number; + }; +} + +export default function BillsPage() { + const t = useTranslations('Bills'); + const [allBills, setAllBills] = useState([]); + const [loading, setLoading] = useState(true); + const [error, setError] = useState(null); + const [searchQuery, setSearchQuery] = useState(''); + const [currentPage, setCurrentPage] = useState(1); + const [pagination, setPagination] = useState({ + page: 1, + limit: 10, + totalCount: 0, + totalPages: 0, + }); + + useEffect(() => { + const fetchBills = async () => { + try { + setLoading(true); + setError(null); + const params = new URLSearchParams({ + page: currentPage.toString(), + limit: '10', + ...(searchQuery && { search: searchQuery }), + }); + const response = await fetch(`/api/bills?${params}`); + if (!response.ok) { + throw new Error('Failed to fetch bills'); + } + const data: BillsResponse = await response.json(); + setAllBills(data.data); + setPagination(data.pagination); + } catch (err) { + setError((err as Error).message); + } finally { + setLoading(false); + } + }; + + fetchBills(); + }, [currentPage, searchQuery]); + + const getStatusClassName = (status: string) => { + switch (status) { + case 'passed': return 'bg-green-100 text-green-800'; + case 'rejected': return 'bg-red-100 text-red-800'; + default: return 'bg-yellow-100 text-yellow-800'; + } + }; + + const getStatusLabel = (status: string) => { + switch (status) { + case 'passed': return t('statusPassed'); + case 'rejected': return t('statusRejected'); + default: return t('statusPending'); + } + }; + + const handleSearch = (value: string) => { + setSearchQuery(value); + setCurrentPage(1); // Reset to first page on new search + }; + + const handlePageChange = (page: number) => { + setCurrentPage(page); + window.scrollTo({ top: 0, behavior: 'smooth' }); + }; + + return ( +
+

{t('title')}

+ + {/* Search Bar */} +
+ + handleSearch(e.target.value)} + className="pl-10" + /> +
+ + {loading && ( +
+ {[...Array(3)].map((_, index) => ( +
+ + +
+ ))} +
+ )} + + {error && ( +

{t('errorLoading', { error })}

+ )} + + {!loading && !error && ( + <> + {allBills.length === 0 ? ( +
+

{t('noResults')}

+
+ ) : ( + <> +
+ {allBills.map((bill) => ( + +

{bill.title}

+
+ + {getStatusLabel(bill.status)} + +
+ + ))} +
+ + {/* Pagination */} +
+ +

+ {t('showing', { count: allBills.length, total: pagination.totalCount })} +

+
+ + )} + + )} +
+ ); +} diff --git a/app/[locale]/chat.backup/page.tsx b/app/[locale]/chat.backup/page.tsx new file mode 100644 index 0000000..5b27352 --- /dev/null +++ b/app/[locale]/chat.backup/page.tsx @@ -0,0 +1,295 @@ +"use client" + +import { useEffect, useRef, useState, Suspense } from "react" +import { useChat } from "ai/react" +import { + Bot, + CopyIcon, + MessageSquare, + RefreshCcw, + SendIcon, + User, + LogOut, + Loader2, +} from "lucide-react" +import Markdown from "react-markdown" +import remarkGfm from "remark-gfm" +import { useRouter, useSearchParams } from "next/navigation" +import { useToast } from "@/hooks/use-toast" +import { trackChatMessage, trackNewChatThread } from "@/lib/analytics" + +import { Button } from "@/components/ui/button" +import { + ChatBubble, + ChatBubbleAction, + ChatBubbleAvatar, + ChatBubbleMessage, +} from "@/components/ui/chat/chat-bubble" +import { ChatInput } from "@/components/ui/chat/chat-input" + +const ChatAiIcons = [ + { icon: CopyIcon, label: "Copy" }, + { icon: RefreshCcw, label: "Refresh" }, +] + +function ChatPageContent() { + const [isGenerating, setIsGenerating] = useState(false) + const [isAuthenticated, setIsAuthenticated] = useState(false) + const router = useRouter() + const { toast } = useToast() + const searchParams = useSearchParams() + const [threadId, setThreadId] = useState(null) + const [isClient, setIsClient] = useState(false) + + useEffect(() => { + setIsClient(true) + }, []) + + useEffect(() => { + const accessToken = localStorage.getItem('access_token') + console.log('Auth check - access_token:', accessToken) + setIsAuthenticated(!!accessToken) + }, []) + + useEffect(() => { + const loadOrCreateThread = async () => { + console.log('loadOrCreateThread called, isAuthenticated:', isAuthenticated) + if (!isAuthenticated) return + + const pehchanId = localStorage.getItem('pehchan_id') + console.log('Pehchan ID:', pehchanId) + if (!pehchanId) return + + const threadIdParam = searchParams.get('thread') + if (threadIdParam) { + console.log('Loading thread:', threadIdParam) + const response = await fetch(`/api/chat/threads/${threadIdParam}?pehchan_id=${pehchanId}`) + const thread = await response.json() + console.log('Loaded thread:', thread) + + if (thread) { + setThreadId(thread.id) + setMessages(thread.messages) + } + } else { + console.log('Creating new thread') + const response = await fetch('/api/chat/threads', { + method: 'POST', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + pehchanId, + title: 'New Chat' + }) + }) + const thread = await response.json() + console.log('Created thread:', thread) + + if (thread) { + setThreadId(thread.id) + trackNewChatThread() + router.push(`/chat?thread=${thread.id}`) + } + } + } + + loadOrCreateThread() + }, [isAuthenticated, searchParams]) + + const handleLogout = () => { + localStorage.clear() + window.dispatchEvent(new Event('localStorageChange')) + toast({ + title: "Logged out", + description: "You have been successfully logged out" + }) + router.refresh() + } + + const { + messages, + input, + handleInputChange, + handleSubmit, + isLoading, + reload, + setMessages, + } = useChat({ + api: "/api/chat", + initialMessages: [ + { + id: "welcome", + role: "assistant", + content: + "Hello! I am Numainda, your guide to Pakistan's constitutional and electoral information. How may I assist you today?", + }, + ], + onResponse: (response) => { + if (response) { + setIsGenerating(false) + // Scroll to bottom when response starts streaming + messagesEndRef.current?.scrollIntoView({ behavior: "smooth" }) + + if (threadId) { + fetch(`/api/chat/threads/${threadId}`, { + method: 'PATCH', + headers: { 'Content-Type': 'application/json' }, + body: JSON.stringify({ + messages, + title: messages[1]?.content.slice(0, 100) || 'New Chat', + pehchanId: localStorage.getItem('pehchan_id') + }) + }) + } + } + }, + onError: (error) => { + if (error) setIsGenerating(false) + }, + }) + + const messagesEndRef = useRef(null) + + useEffect(() => { + messagesEndRef.current?.scrollIntoView({ behavior: "smooth" }) + }, [messages]) + + const copyToClipboard = async (text: string) => { + try { + await navigator.clipboard.writeText(text) + toast({ + title: "Copied to clipboard", + description: "Message content has been copied to your clipboard", + }) + } catch (err) { + toast({ + title: "Failed to copy", + description: "Could not copy the message to clipboard", + variant: "destructive", + }) + } + } + + return ( +
+
+ {/* Header */} +
+
+ + Numainda Chat +
+
+ + {/* Messages container */} +
+
+ {isClient && messages.map((message) => ( + + + ) : ( + + ) + } + /> + + + {message.content} + + + {message.role === "assistant" && isClient && ( + copyToClipboard(message.content)} + > + + Copy message + + } /> + )} + + ))} + {isGenerating && isClient && ( + + } + /> + +
+ + Numainda is thinking... +
+
+
+ )} +
+
+
+ + {/* Input - now will stay fixed at bottom */} +
+
+
{ + e.preventDefault() + if (!input?.trim() || isLoading) return + setIsGenerating(true) + trackChatMessage(threadId || undefined) + handleSubmit(e) + }} + > + { + if (e.key === "Enter" && !e.shiftKey) { + e.preventDefault() + if (!input?.trim() || isLoading) return + setIsGenerating(true) + trackChatMessage(threadId || undefined) + handleSubmit(e) + } + }} + /> + + +
+
+
+
+ ) +} + +export default function ChatPage() { + return ( + + +
}> + + + ) +} diff --git a/app/[locale]/chat/page.tsx b/app/[locale]/chat/page.tsx new file mode 100644 index 0000000..c187cb2 --- /dev/null +++ b/app/[locale]/chat/page.tsx @@ -0,0 +1,263 @@ +'use client' + +import { Suspense, useState, useRef, useEffect } from "react" +import { useSearchParams } from "next/navigation" +import { useChat } from "ai/react" +import { + Bot, + CopyIcon, + SendIcon, + User, + Loader2, + ArrowLeft, + Trash2, +} from "lucide-react" +import { Link } from "@/i18n/navigation" +import { useTranslations } from "next-intl" +import Markdown from "react-markdown" +import remarkGfm from "remark-gfm" +import { useToast } from "@/hooks/use-toast" +import { trackChatMessage } from "@/lib/analytics" +import { Button } from "@/components/ui/button" + +export default function ChatPage() { + return ( + + +
+ }> + + + ) +} + +function ChatContent() { + const t = useTranslations('Chat') + const searchParams = useSearchParams() + const initialQuery = searchParams.get("q") + const [hasSubmittedInitial, setHasSubmittedInitial] = useState(false) + const [isGenerating, setIsGenerating] = useState(false) + const { toast } = useToast() + const messagesEndRef = useRef(null) + const inputRef = useRef(null) + + const { + messages, + input, + handleInputChange, + handleSubmit, + isLoading, + setMessages, + append, + } = useChat({ + api: "/api/chat", + initialMessages: [ + { + id: "welcome", + role: "assistant", + content: + "Hello! I am Numainda, your guide to Pakistan's constitutional and electoral information. How may I assist you today?", + }, + ], + onResponse: () => { + setIsGenerating(false) + }, + onError: () => { + setIsGenerating(false) + }, + }) + + // Auto-submit the initial query from URL + useEffect(() => { + if (initialQuery && !hasSubmittedInitial) { + setHasSubmittedInitial(true) + setIsGenerating(true) + trackChatMessage() + append({ role: "user", content: initialQuery }) + } + }, [initialQuery, hasSubmittedInitial, append]) + + // Auto-scroll to latest message + useEffect(() => { + messagesEndRef.current?.scrollIntoView({ behavior: "smooth" }) + }, [messages]) + + // Focus input on mount + useEffect(() => { + if (!initialQuery) { + inputRef.current?.focus() + } + }, [initialQuery]) + + const copyToClipboard = async (text: string) => { + try { + await navigator.clipboard.writeText(text) + toast({ + title: t('copiedTitle'), + description: t('copiedDesc'), + }) + } catch { + toast({ + title: t('copyFailedTitle'), + variant: "destructive", + }) + } + } + + const handleClearChat = () => { + setMessages([ + { + id: "welcome", + role: "assistant", + content: t('welcomeMessage'), + }, + ]) + } + + const onSubmit = (e: React.FormEvent) => { + e.preventDefault() + if (!input?.trim() || isLoading) return + setIsGenerating(true) + trackChatMessage() + handleSubmit(e) + } + + return ( +
+ {/* Chat Header */} +
+
+ + + {t('backToHome')} + +
+ + {t('numainda')} +
+ +
+
+ + {/* Messages Area */} +
+
+
+ {messages.map((message) => ( +
+ {message.role === "assistant" && ( +
+ +
+ )} +
+ + {message.id === "welcome" ? t('welcomeMessage') : message.content} + + {message.role === "assistant" && message.id !== "welcome" && ( + + )} +
+ {message.role === "user" && ( +
+ +
+ )} +
+ ))} + {isGenerating && ( +
+
+ +
+
+
+ + {t('thinking')} +
+
+
+ )} +
+
+
+
+ + {/* Input Area */} +
+
+
+