create-pet-adopt 0.0.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +120 -0
- package/index.js +920 -0
- package/package.json +43 -1
- package/template/.env.example +136 -0
- package/template/.pet-adopt/template.json +581 -0
- package/template/LICENSE +21 -0
- package/template/README.md +109 -0
- package/template/_gitignore +28 -0
- package/template/_pnpm-lock.yaml +9251 -0
- package/template/assets/sample-pet.png +0 -0
- package/template/components.json +25 -0
- package/template/docker-compose.yml +110 -0
- package/template/drizzle/pg/0000_initial.sql +176 -0
- package/template/drizzle/pg/0001_greedy_the_renegades.sql +1 -0
- package/template/drizzle/pg/0002_fuzzy_the_renegades.sql +1 -0
- package/template/drizzle/pg/0003_thin_multiple_man.sql +1 -0
- package/template/drizzle/pg/0004_boring_norman_osborn.sql +15 -0
- package/template/drizzle/pg/0005_bitter_proemial_gods.sql +3 -0
- package/template/drizzle/pg/0006_friendly_black_knight.sql +2 -0
- package/template/drizzle/pg/0007_wise_ozymandias.sql +11 -0
- package/template/drizzle/pg/0008_messy_human_fly.sql +2 -0
- package/template/drizzle/pg/0009_amused_lady_bullseye.sql +1 -0
- package/template/drizzle/pg/0010_cute_mauler.sql +7 -0
- package/template/drizzle/pg/0011_clear_purple_man.sql +3 -0
- package/template/drizzle/pg/0012_tiresome_gunslinger.sql +2 -0
- package/template/drizzle/pg/0013_awesome_wong.sql +18 -0
- package/template/drizzle/pg/0014_fantastic_sumo.sql +12 -0
- package/template/drizzle/pg/0015_pink_carnage.sql +12 -0
- package/template/drizzle/pg/0016_sloppy_king_bedlam.sql +2 -0
- package/template/drizzle/pg/0017_steep_warhawk.sql +15 -0
- package/template/drizzle/pg/0018_mixed_otto_octavius.sql +4 -0
- package/template/drizzle/pg/0019_talented_rocket_raccoon.sql +1 -0
- package/template/drizzle/pg/0020_worthless_zodiak.sql +19 -0
- package/template/drizzle/pg/0021_adorable_squadron_supreme.sql +1 -0
- package/template/drizzle/pg/0022_soft_pixie.sql +5 -0
- package/template/drizzle/pg/0023_fluffy_quasar.sql +1 -0
- package/template/drizzle/pg/0024_uneven_ken_ellis.sql +2 -0
- package/template/drizzle/pg/0025_rich_white_queen.sql +3 -0
- package/template/drizzle/pg/0026_spooky_komodo.sql +16 -0
- package/template/drizzle/pg/0027_big_thunderbolts.sql +2 -0
- package/template/drizzle/pg/meta/0000_snapshot.json +1265 -0
- package/template/drizzle/pg/meta/0001_snapshot.json +1272 -0
- package/template/drizzle/pg/meta/0002_snapshot.json +1278 -0
- package/template/drizzle/pg/meta/0003_snapshot.json +1284 -0
- package/template/drizzle/pg/meta/0004_snapshot.json +1401 -0
- package/template/drizzle/pg/meta/0005_snapshot.json +1401 -0
- package/template/drizzle/pg/meta/0006_snapshot.json +1414 -0
- package/template/drizzle/pg/meta/0007_snapshot.json +1485 -0
- package/template/drizzle/pg/meta/0008_snapshot.json +1504 -0
- package/template/drizzle/pg/meta/0009_snapshot.json +1510 -0
- package/template/drizzle/pg/meta/0010_snapshot.json +1556 -0
- package/template/drizzle/pg/meta/0011_snapshot.json +1574 -0
- package/template/drizzle/pg/meta/0012_snapshot.json +1586 -0
- package/template/drizzle/pg/meta/0013_snapshot.json +1730 -0
- package/template/drizzle/pg/meta/0014_snapshot.json +1805 -0
- package/template/drizzle/pg/meta/0015_snapshot.json +1883 -0
- package/template/drizzle/pg/meta/0016_snapshot.json +1897 -0
- package/template/drizzle/pg/meta/0017_snapshot.json +2013 -0
- package/template/drizzle/pg/meta/0018_snapshot.json +1988 -0
- package/template/drizzle/pg/meta/0019_snapshot.json +1994 -0
- package/template/drizzle/pg/meta/0020_snapshot.json +2108 -0
- package/template/drizzle/pg/meta/0021_snapshot.json +2114 -0
- package/template/drizzle/pg/meta/0022_snapshot.json +2126 -0
- package/template/drizzle/pg/meta/0023_snapshot.json +2132 -0
- package/template/drizzle/pg/meta/0024_snapshot.json +2151 -0
- package/template/drizzle/pg/meta/0025_snapshot.json +2169 -0
- package/template/drizzle/pg/meta/0026_snapshot.json +2294 -0
- package/template/drizzle/pg/meta/0027_snapshot.json +2330 -0
- package/template/drizzle/pg/meta/_journal.json +202 -0
- package/template/drizzle/sqlite/0000_initial.sql +176 -0
- package/template/drizzle/sqlite/0001_easy_sebastian_shaw.sql +1 -0
- package/template/drizzle/sqlite/0002_past_king_cobra.sql +1 -0
- package/template/drizzle/sqlite/0003_organic_masked_marvel.sql +1 -0
- package/template/drizzle/sqlite/0004_panoramic_inhumans.sql +15 -0
- package/template/drizzle/sqlite/0005_small_sunset_bain.sql +19 -0
- package/template/drizzle/sqlite/0006_narrow_medusa.sql +2 -0
- package/template/drizzle/sqlite/0007_gray_grandmaster.sql +10 -0
- package/template/drizzle/sqlite/0008_chief_toxin.sql +1 -0
- package/template/drizzle/sqlite/0009_vengeful_tag.sql +1 -0
- package/template/drizzle/sqlite/0010_kind_klaw.sql +7 -0
- package/template/drizzle/sqlite/0011_overrated_meltdown.sql +3 -0
- package/template/drizzle/sqlite/0012_robust_next_avengers.sql +2 -0
- package/template/drizzle/sqlite/0013_melodic_kitty_pryde.sql +18 -0
- package/template/drizzle/sqlite/0014_stormy_cyclops.sql +12 -0
- package/template/drizzle/sqlite/0015_parallel_mongu.sql +11 -0
- package/template/drizzle/sqlite/0016_grey_quicksilver.sql +2 -0
- package/template/drizzle/sqlite/0017_daily_psylocke.sql +15 -0
- package/template/drizzle/sqlite/0018_whole_redwing.sql +4 -0
- package/template/drizzle/sqlite/0019_spotty_mandroid.sql +1 -0
- package/template/drizzle/sqlite/0020_wild_wendell_rand.sql +19 -0
- package/template/drizzle/sqlite/0021_calm_lockheed.sql +1 -0
- package/template/drizzle/sqlite/0022_lonely_emma_frost.sql +5 -0
- package/template/drizzle/sqlite/0023_elite_tony_stark.sql +1 -0
- package/template/drizzle/sqlite/0024_little_lily_hollister.sql +1 -0
- package/template/drizzle/sqlite/0025_tough_shotgun.sql +3 -0
- package/template/drizzle/sqlite/0026_faithful_mephistopheles.sql +16 -0
- package/template/drizzle/sqlite/0027_rapid_arclight.sql +2 -0
- package/template/drizzle/sqlite/meta/0000_snapshot.json +1237 -0
- package/template/drizzle/sqlite/meta/0001_snapshot.json +1245 -0
- package/template/drizzle/sqlite/meta/0002_snapshot.json +1252 -0
- package/template/drizzle/sqlite/meta/0003_snapshot.json +1259 -0
- package/template/drizzle/sqlite/meta/0004_snapshot.json +1369 -0
- package/template/drizzle/sqlite/meta/0005_snapshot.json +1369 -0
- package/template/drizzle/sqlite/meta/0006_snapshot.json +1384 -0
- package/template/drizzle/sqlite/meta/0007_snapshot.json +1459 -0
- package/template/drizzle/sqlite/meta/0008_snapshot.json +1479 -0
- package/template/drizzle/sqlite/meta/0009_snapshot.json +1486 -0
- package/template/drizzle/sqlite/meta/0010_snapshot.json +1533 -0
- package/template/drizzle/sqlite/meta/0011_snapshot.json +1554 -0
- package/template/drizzle/sqlite/meta/0012_snapshot.json +1568 -0
- package/template/drizzle/sqlite/meta/0013_snapshot.json +1687 -0
- package/template/drizzle/sqlite/meta/0014_snapshot.json +1769 -0
- package/template/drizzle/sqlite/meta/0015_snapshot.json +1852 -0
- package/template/drizzle/sqlite/meta/0016_snapshot.json +1867 -0
- package/template/drizzle/sqlite/meta/0017_snapshot.json +1973 -0
- package/template/drizzle/sqlite/meta/0018_snapshot.json +1944 -0
- package/template/drizzle/sqlite/meta/0019_snapshot.json +1951 -0
- package/template/drizzle/sqlite/meta/0020_snapshot.json +2077 -0
- package/template/drizzle/sqlite/meta/0021_snapshot.json +2084 -0
- package/template/drizzle/sqlite/meta/0022_snapshot.json +2098 -0
- package/template/drizzle/sqlite/meta/0023_snapshot.json +2105 -0
- package/template/drizzle/sqlite/meta/0024_snapshot.json +2125 -0
- package/template/drizzle/sqlite/meta/0025_snapshot.json +2146 -0
- package/template/drizzle/sqlite/meta/0026_snapshot.json +2265 -0
- package/template/drizzle/sqlite/meta/0027_snapshot.json +2280 -0
- package/template/drizzle/sqlite/meta/_journal.json +202 -0
- package/template/drizzle.pg.config.ts +8 -0
- package/template/drizzle.sqlite.config.ts +8 -0
- package/template/eslint.config.mjs +22 -0
- package/template/next.config.ts +153 -0
- package/template/package.json +102 -0
- package/template/pet-adopt.blocks.ts +9 -0
- package/template/pet-adopt.config.ts +17 -0
- package/template/pnpm-workspace.yaml +19 -0
- package/template/postcss.config.mjs +5 -0
- package/template/scripts/check-routes.ts +405 -0
- package/template/scripts/check-schemas.ts +58 -0
- package/template/scripts/migrate-all.ts +25 -0
- package/template/scripts/migrate-on-build.ts +71 -0
- package/template/scripts/migrate.ts +20 -0
- package/template/scripts/plugin-generate.ts +92 -0
- package/template/scripts/reset-password.ts +45 -0
- package/template/scripts/reset-two-factor.ts +53 -0
- package/template/scripts/seed.ts +79 -0
- package/template/scripts/setup-env.ts +91 -0
- package/template/scripts/storage-check.ts +53 -0
- package/template/src/app/(admin)/admin/account/AccountForms.tsx +194 -0
- package/template/src/app/(admin)/admin/account/page.tsx +59 -0
- package/template/src/app/(admin)/admin/activity/page.tsx +76 -0
- package/template/src/app/(admin)/admin/authentication/archived/page.tsx +24 -0
- package/template/src/app/(admin)/admin/authentication/layout.tsx +20 -0
- package/template/src/app/(admin)/admin/authentication/page.tsx +36 -0
- package/template/src/app/(admin)/admin/authentication/providers/page.tsx +33 -0
- package/template/src/app/(admin)/admin/email/layout.tsx +21 -0
- package/template/src/app/(admin)/admin/email/page.tsx +43 -0
- package/template/src/app/(admin)/admin/email/templates/page.tsx +38 -0
- package/template/src/app/(admin)/admin/error.tsx +36 -0
- package/template/src/app/(admin)/admin/layout.tsx +26 -0
- package/template/src/app/(admin)/admin/loading.tsx +9 -0
- package/template/src/app/(admin)/admin/media/[id]/page.tsx +97 -0
- package/template/src/app/(admin)/admin/media/page.tsx +34 -0
- package/template/src/app/(admin)/admin/media/search-params.ts +16 -0
- package/template/src/app/(admin)/admin/page.tsx +79 -0
- package/template/src/app/(admin)/admin/pages/PageForm.tsx +604 -0
- package/template/src/app/(admin)/admin/pages/[id]/page.tsx +51 -0
- package/template/src/app/(admin)/admin/pages/new/page.tsx +19 -0
- package/template/src/app/(admin)/admin/pages/page.tsx +49 -0
- package/template/src/app/(admin)/admin/pets/PetForm.tsx +437 -0
- package/template/src/app/(admin)/admin/pets/[id]/page.tsx +41 -0
- package/template/src/app/(admin)/admin/pets/new/page.tsx +26 -0
- package/template/src/app/(admin)/admin/pets/page.tsx +70 -0
- package/template/src/app/(admin)/admin/pets/search-params.ts +16 -0
- package/template/src/app/(admin)/admin/plugins/[plugin]/[[...path]]/page.tsx +73 -0
- package/template/src/app/(admin)/admin/plugins/page.tsx +66 -0
- package/template/src/app/(admin)/admin/settings/SettingsForm.tsx +644 -0
- package/template/src/app/(admin)/admin/settings/email/page.tsx +9 -0
- package/template/src/app/(admin)/admin/settings/page.tsx +40 -0
- package/template/src/app/(admin)/admin/settings/templates/page.tsx +9 -0
- package/template/src/app/(admin)/admin/theme/[id]/page.tsx +28 -0
- package/template/src/app/(admin)/admin/theme/page.tsx +30 -0
- package/template/src/app/(admin)/admin/users/page.tsx +33 -0
- package/template/src/app/(admin)/layout.tsx +75 -0
- package/template/src/app/(admin)/providers.tsx +42 -0
- package/template/src/app/(auth)/admin/confirm-email/page.tsx +40 -0
- package/template/src/app/(auth)/admin/invite/page.tsx +38 -0
- package/template/src/app/(auth)/admin/login/DemoSignIn.tsx +69 -0
- package/template/src/app/(auth)/admin/login/page.tsx +83 -0
- package/template/src/app/(auth)/admin/reset-password/page.tsx +73 -0
- package/template/src/app/(auth)/error.tsx +9 -0
- package/template/src/app/(auth)/layout.tsx +71 -0
- package/template/src/app/(editor)/EditorToast.tsx +43 -0
- package/template/src/app/(editor)/edit/[id]/PageEditor.tsx +586 -0
- package/template/src/app/(editor)/edit/[id]/actions.ts +139 -0
- package/template/src/app/(editor)/edit/[id]/page.tsx +76 -0
- package/template/src/app/(editor)/edit/[id]/preview/page.tsx +81 -0
- package/template/src/app/(editor)/edit/email/[id]/EmailEditor.tsx +236 -0
- package/template/src/app/(editor)/edit/email/[id]/page.tsx +64 -0
- package/template/src/app/(editor)/edit/theme-preview/page.tsx +94 -0
- package/template/src/app/(editor)/editor.css +223 -0
- package/template/src/app/(editor)/error.tsx +32 -0
- package/template/src/app/(editor)/layout.tsx +67 -0
- package/template/src/app/(frontend)/[slug]/page.tsx +53 -0
- package/template/src/app/(frontend)/fonts.ts +8 -0
- package/template/src/app/(frontend)/layout.tsx +107 -0
- package/template/src/app/(frontend)/not-found.tsx +16 -0
- package/template/src/app/(frontend)/page.tsx +42 -0
- package/template/src/app/(frontend)/pets/[slug]/page.tsx +92 -0
- package/template/src/app/(frontend)/pets/page.tsx +42 -0
- package/template/src/app/(frontend)/styles.css +537 -0
- package/template/src/app/(setup)/error.tsx +9 -0
- package/template/src/app/(setup)/layout.tsx +41 -0
- package/template/src/app/(setup)/setup/page.tsx +105 -0
- package/template/src/app/(setup)/setup/storage-check.ts +43 -0
- package/template/src/app/api/auth/[...all]/route.ts +144 -0
- package/template/src/app/health/route.ts +9 -0
- package/template/src/app/media/[...path]/route.ts +45 -0
- package/template/src/app/media/email/[name]/route.ts +60 -0
- package/template/src/app/robots.ts +19 -0
- package/template/src/app/sitemap.ts +24 -0
- package/template/src/components/admin/AdminNav.tsx +153 -0
- package/template/src/components/admin/AdminShell.tsx +107 -0
- package/template/src/components/admin/DemoNotice.tsx +31 -0
- package/template/src/components/admin/EmailConfirmBanner.tsx +44 -0
- package/template/src/components/admin/EmptyState.tsx +10 -0
- package/template/src/components/admin/ErrorSummary.tsx +72 -0
- package/template/src/components/admin/MediaDetails.tsx +218 -0
- package/template/src/components/admin/MediaGrid.tsx +307 -0
- package/template/src/components/admin/MediaLibrary.tsx +103 -0
- package/template/src/components/admin/MediaPager.tsx +66 -0
- package/template/src/components/admin/PageHeader.tsx +22 -0
- package/template/src/components/admin/PhoneInput.tsx +128 -0
- package/template/src/components/admin/PluginWidgetBoundary.tsx +38 -0
- package/template/src/components/admin/PluginWidgets.tsx +51 -0
- package/template/src/components/admin/RemountOnNavigate.tsx +37 -0
- package/template/src/components/admin/StatusBadge.tsx +16 -0
- package/template/src/components/admin/UploadPhotosDialog.tsx +387 -0
- package/template/src/components/admin/UserAvatar.tsx +18 -0
- package/template/src/components/admin/UserMenu.tsx +118 -0
- package/template/src/components/admin/ViewSiteLink.tsx +24 -0
- package/template/src/components/admin/account/ConnectedProviders.tsx +91 -0
- package/template/src/components/admin/account/DeleteAccountCard.tsx +136 -0
- package/template/src/components/admin/account/EmailCard.tsx +137 -0
- package/template/src/components/admin/account/ProfilePicture.tsx +159 -0
- package/template/src/components/admin/activity/ActivityFilters.tsx +146 -0
- package/template/src/components/admin/activity/ActivityLog.tsx +159 -0
- package/template/src/components/admin/activity/RecentActivity.tsx +52 -0
- package/template/src/components/admin/demo-mode.tsx +17 -0
- package/template/src/components/admin/nav-items.ts +47 -0
- package/template/src/components/admin/pages/PageDetails.tsx +198 -0
- package/template/src/components/admin/pages/PageVersions.tsx +296 -0
- package/template/src/components/admin/pages/PagesTable.tsx +467 -0
- package/template/src/components/admin/pets/FilterBar.tsx +154 -0
- package/template/src/components/admin/pets/PetCard.tsx +170 -0
- package/template/src/components/admin/pets/PetList.tsx +112 -0
- package/template/src/components/admin/pets/PetListSkeleton.tsx +84 -0
- package/template/src/components/admin/pets/PetPagination.tsx +91 -0
- package/template/src/components/admin/pets/form/AgeFields.tsx +132 -0
- package/template/src/components/admin/pets/form/LocationFields.tsx +231 -0
- package/template/src/components/admin/pets/form/MediaPickerDialog.tsx +359 -0
- package/template/src/components/admin/pets/form/PhotosField.tsx +176 -0
- package/template/src/components/admin/pets/form/RichTextField.tsx +438 -0
- package/template/src/components/admin/pets/form/SeoImageField.tsx +87 -0
- package/template/src/components/admin/pets/form/SeoPreview.tsx +142 -0
- package/template/src/components/admin/pets/form/fields.tsx +434 -0
- package/template/src/components/admin/pets/form/rich-text-extensions.ts +45 -0
- package/template/src/components/admin/pets/timeline/PetTimeline.tsx +297 -0
- package/template/src/components/admin/pets/timeline/TimelineEntryForm.tsx +289 -0
- package/template/src/components/admin/pets/timeline/TimelinePhotosField.tsx +173 -0
- package/template/src/components/admin/plugins/PluginNotReady.tsx +28 -0
- package/template/src/components/admin/plugins/PluginOverview.tsx +121 -0
- package/template/src/components/admin/plugins/SendTestEmail.tsx +70 -0
- package/template/src/components/admin/settings/AuthProviders.tsx +373 -0
- package/template/src/components/admin/settings/AuthenticationNav.tsx +42 -0
- package/template/src/components/admin/settings/EmailNav.tsx +40 -0
- package/template/src/components/admin/settings/EmailSettingsForm.tsx +325 -0
- package/template/src/components/admin/settings/EmailTemplates.tsx +551 -0
- package/template/src/components/admin/settings/RegionFields.tsx +203 -0
- package/template/src/components/admin/site-time.tsx +26 -0
- package/template/src/components/admin/theme/ThemeEditor.tsx +467 -0
- package/template/src/components/admin/theme/ThemeLibrary.tsx +339 -0
- package/template/src/components/admin/theme/ThemeSwatches.tsx +30 -0
- package/template/src/components/admin/theme/theme-utils.ts +32 -0
- package/template/src/components/admin/two-factor/BackupCodeList.tsx +54 -0
- package/template/src/components/admin/two-factor/TwoFactorCard.tsx +237 -0
- package/template/src/components/admin/two-factor/TwoFactorRequired.tsx +52 -0
- package/template/src/components/admin/two-factor/TwoFactorSetup.tsx +180 -0
- package/template/src/components/admin/use-unsaved-changes.tsx +101 -0
- package/template/src/components/admin/users/ArchivedAccounts.tsx +159 -0
- package/template/src/components/admin/users/InviteDialogs.tsx +131 -0
- package/template/src/components/admin/users/TwoFactorRoles.tsx +80 -0
- package/template/src/components/admin/users/UserDialogs.tsx +681 -0
- package/template/src/components/admin/users/UsersTable.tsx +374 -0
- package/template/src/components/admin/view-only.tsx +43 -0
- package/template/src/components/auth/AcceptInviteForm.tsx +123 -0
- package/template/src/components/auth/AuthNav.tsx +80 -0
- package/template/src/components/auth/ConfirmEmailForm.tsx +73 -0
- package/template/src/components/auth/LoginForm.tsx +250 -0
- package/template/src/components/auth/PageError.tsx +37 -0
- package/template/src/components/auth/ProviderSignIn.tsx +53 -0
- package/template/src/components/auth/ResetPasswordForm.tsx +267 -0
- package/template/src/components/demo/DemoBanner.tsx +38 -0
- package/template/src/components/demo/SiteDemoBanner.tsx +22 -0
- package/template/src/components/demo/wording.ts +21 -0
- package/template/src/components/setup/SetupAccountForm.tsx +93 -0
- package/template/src/components/setup/SetupDone.tsx +95 -0
- package/template/src/components/setup/SetupNav.tsx +49 -0
- package/template/src/components/setup/SetupSampleContent.tsx +67 -0
- package/template/src/components/setup/SetupSiteForm.tsx +104 -0
- package/template/src/components/setup/SetupThemePicker.tsx +73 -0
- package/template/src/components/setup/SkipSetup.tsx +35 -0
- package/template/src/components/site/BuilderContent.tsx +46 -0
- package/template/src/components/site/CopyButton.tsx +28 -0
- package/template/src/components/site/ImageCarousel.tsx +52 -0
- package/template/src/components/site/PetCard.tsx +32 -0
- package/template/src/components/site/PetCatalog.tsx +106 -0
- package/template/src/components/site/PetGallery.tsx +75 -0
- package/template/src/components/site/PetTimeline.tsx +82 -0
- package/template/src/components/site/RemountOnNavigate.tsx +13 -0
- package/template/src/components/site/RichText.tsx +56 -0
- package/template/src/components/site/SmartLink.tsx +37 -0
- package/template/src/components/site/SocialIcons.tsx +26 -0
- package/template/src/components/site/ThemePreviewBridge.tsx +29 -0
- package/template/src/components/site/ThemeStyle.tsx +22 -0
- package/template/src/components/site/ThemeToggle.tsx +36 -0
- package/template/src/components/site/WhatsAppButton.tsx +27 -0
- package/template/src/components/site/timeline-format.ts +20 -0
- package/template/src/db/client.ts +702 -0
- package/template/src/db/compare-tables.ts +41 -0
- package/template/src/db/migrate.ts +28 -0
- package/template/src/db/plugin-migrations.ts +167 -0
- package/template/src/db/schema/pg.ts +484 -0
- package/template/src/db/schema/sqlite.ts +492 -0
- package/template/src/instrumentation.ts +110 -0
- package/template/src/lib/activity.ts +29 -0
- package/template/src/lib/admin/call-action.ts +19 -0
- package/template/src/lib/admin/initials.ts +9 -0
- package/template/src/lib/admin/media-cache.ts +16 -0
- package/template/src/lib/admin/media-page.ts +3 -0
- package/template/src/lib/admin/pet-form.ts +242 -0
- package/template/src/lib/admin/pets-cache.ts +22 -0
- package/template/src/lib/admin/unwrap-client.ts +11 -0
- package/template/src/lib/admin/unwrap.ts +38 -0
- package/template/src/lib/admin/use-media-list.ts +41 -0
- package/template/src/lib/admin/use-pet-list.ts +58 -0
- package/template/src/lib/age.ts +117 -0
- package/template/src/lib/auth-provider-errors.ts +38 -0
- package/template/src/lib/cache.ts +69 -0
- package/template/src/lib/color-mode.ts +48 -0
- package/template/src/lib/demo.ts +78 -0
- package/template/src/lib/email-address.ts +9 -0
- package/template/src/lib/email-template.ts +691 -0
- package/template/src/lib/links.ts +78 -0
- package/template/src/lib/mail-error.ts +38 -0
- package/template/src/lib/media-name.ts +31 -0
- package/template/src/lib/options.ts +134 -0
- package/template/src/lib/pagination.ts +28 -0
- package/template/src/lib/pet-placeholders.ts +34 -0
- package/template/src/lib/pet-seo.ts +40 -0
- package/template/src/lib/pet-timeline.ts +62 -0
- package/template/src/lib/phone.ts +129 -0
- package/template/src/lib/places.ts +84 -0
- package/template/src/lib/queries.ts +549 -0
- package/template/src/lib/revalidate.ts +32 -0
- package/template/src/lib/rich-text.ts +215 -0
- package/template/src/lib/seo.ts +121 -0
- package/template/src/lib/slugify.ts +11 -0
- package/template/src/lib/theme.ts +546 -0
- package/template/src/lib/utils.ts +2 -0
- package/template/src/lib/whatsapp.ts +29 -0
- package/template/src/lib/zod-schema/auth.ts +56 -0
- package/template/src/lib/zod-schema/page.ts +57 -0
- package/template/src/lib/zod-schema/pet-timeline.ts +118 -0
- package/template/src/lib/zod-schema/pet.ts +172 -0
- package/template/src/lib/zod-schema/settings.ts +162 -0
- package/template/src/plugins/host.ts +117 -0
- package/template/src/plugins/icon.ts +89 -0
- package/template/src/plugins/registry.ts +369 -0
- package/template/src/plugins/storage-rules.ts +87 -0
- package/template/src/plugins/storage.ts +184 -0
- package/template/src/puck/actions.ts +46 -0
- package/template/src/puck/config.tsx +1693 -0
- package/template/src/puck/data.ts +196 -0
- package/template/src/puck/demo-mode.tsx +20 -0
- package/template/src/puck/email-config.tsx +267 -0
- package/template/src/puck/icons.tsx +76 -0
- package/template/src/puck/media-picker.tsx +273 -0
- package/template/src/puck/padding.tsx +71 -0
- package/template/src/puck/pet-page-config.tsx +511 -0
- package/template/src/puck/pet-picker.tsx +40 -0
- package/template/src/puck/plugin-block-data.ts +91 -0
- package/template/src/puck/plugin-blocks.tsx +235 -0
- package/template/src/puck/plugin-choice-field.tsx +87 -0
- package/template/src/puck/sanitize.ts +107 -0
- package/template/src/puck/server.ts +36 -0
- package/template/src/puck/types.ts +41 -0
- package/template/src/server/actions/activity.ts +48 -0
- package/template/src/server/actions/auth-providers.ts +171 -0
- package/template/src/server/actions/auth.ts +217 -0
- package/template/src/server/actions/demo.ts +30 -0
- package/template/src/server/actions/email-change.ts +80 -0
- package/template/src/server/actions/email-templates.ts +144 -0
- package/template/src/server/actions/email.ts +70 -0
- package/template/src/server/actions/media.ts +127 -0
- package/template/src/server/actions/pages.ts +159 -0
- package/template/src/server/actions/password-reset.ts +80 -0
- package/template/src/server/actions/pet-timeline.ts +75 -0
- package/template/src/server/actions/pets.ts +74 -0
- package/template/src/server/actions/places.ts +36 -0
- package/template/src/server/actions/settings.ts +29 -0
- package/template/src/server/actions/setup.ts +72 -0
- package/template/src/server/actions/themes.ts +80 -0
- package/template/src/server/actions/two-factor.ts +306 -0
- package/template/src/server/actions/users.ts +200 -0
- package/template/src/server/activity.ts +409 -0
- package/template/src/server/auth-errors.ts +17 -0
- package/template/src/server/auth-providers.ts +359 -0
- package/template/src/server/auth.ts +266 -0
- package/template/src/server/avatars.ts +263 -0
- package/template/src/server/demo-site.ts +169 -0
- package/template/src/server/email-change.ts +278 -0
- package/template/src/server/email-templates.ts +350 -0
- package/template/src/server/email.ts +442 -0
- package/template/src/server/invites.ts +143 -0
- package/template/src/server/media-url.ts +20 -0
- package/template/src/server/media.ts +236 -0
- package/template/src/server/pages.ts +812 -0
- package/template/src/server/password-reset.ts +158 -0
- package/template/src/server/pending-links.ts +46 -0
- package/template/src/server/pet-timeline.ts +181 -0
- package/template/src/server/pets.ts +555 -0
- package/template/src/server/places.ts +113 -0
- package/template/src/server/privacy.ts +21 -0
- package/template/src/server/provider-endpoints.ts +94 -0
- package/template/src/server/provider-guard.ts +157 -0
- package/template/src/server/result.ts +280 -0
- package/template/src/server/sample-content.ts +368 -0
- package/template/src/server/search-text.ts +43 -0
- package/template/src/server/secret-box.ts +38 -0
- package/template/src/server/session.ts +154 -0
- package/template/src/server/settings.ts +361 -0
- package/template/src/server/setup.ts +110 -0
- package/template/src/server/sitemap.ts +88 -0
- package/template/src/server/storage.ts +267 -0
- package/template/src/server/strip-metadata.ts +357 -0
- package/template/src/server/themes.ts +195 -0
- package/template/src/server/throttle.ts +258 -0
- package/template/src/server/two-factor-codes.ts +32 -0
- package/template/src/server/two-factor.ts +158 -0
- package/template/src/server/types.ts +198 -0
- package/template/src/server/uploads.ts +137 -0
- package/template/src/server/users.ts +500 -0
- package/template/tsconfig.json +44 -0
- package/template/ui/components.json +25 -0
- package/template/ui/package.json +12 -0
- package/template/ui/src/components/alert-dialog.tsx +187 -0
- package/template/ui/src/components/avatar.tsx +108 -0
- package/template/ui/src/components/badge.tsx +51 -0
- package/template/ui/src/components/button.tsx +57 -0
- package/template/ui/src/components/card.tsx +102 -0
- package/template/ui/src/components/carousel.tsx +245 -0
- package/template/ui/src/components/checkbox.tsx +27 -0
- package/template/ui/src/components/combobox.tsx +297 -0
- package/template/ui/src/components/dialog.tsx +159 -0
- package/template/ui/src/components/dropdown-menu.tsx +265 -0
- package/template/ui/src/components/field.tsx +238 -0
- package/template/ui/src/components/input-group.tsx +158 -0
- package/template/ui/src/components/input.tsx +19 -0
- package/template/ui/src/components/label.tsx +19 -0
- package/template/ui/src/components/pagination.tsx +127 -0
- package/template/ui/src/components/popover.tsx +89 -0
- package/template/ui/src/components/radio-group.tsx +37 -0
- package/template/ui/src/components/select.tsx +200 -0
- package/template/ui/src/components/separator.tsx +24 -0
- package/template/ui/src/components/sheet.tsx +138 -0
- package/template/ui/src/components/sidebar.tsx +723 -0
- package/template/ui/src/components/skeleton.tsx +13 -0
- package/template/ui/src/components/switch.tsx +31 -0
- package/template/ui/src/components/table.tsx +115 -0
- package/template/ui/src/components/tabs.tsx +81 -0
- package/template/ui/src/components/textarea.tsx +17 -0
- package/template/ui/src/components/toggle.tsx +44 -0
- package/template/ui/src/components/tooltip.tsx +65 -0
- package/template/ui/src/hooks/use-mobile.ts +21 -0
- package/template/ui/src/lib/utils.ts +2 -0
- package/template/ui/src/styles/globals.css +145 -0
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { useViewOnly } from '@/components/admin/view-only'
|
|
4
|
+
import Link from 'next/link'
|
|
5
|
+
import React from 'react'
|
|
6
|
+
import { FiCheckSquare, FiTrash2, FiX } from 'react-icons/fi'
|
|
7
|
+
|
|
8
|
+
import {
|
|
9
|
+
AlertDialog,
|
|
10
|
+
AlertDialogCancel,
|
|
11
|
+
AlertDialogContent,
|
|
12
|
+
AlertDialogDescription,
|
|
13
|
+
AlertDialogFooter,
|
|
14
|
+
AlertDialogHeader,
|
|
15
|
+
AlertDialogTitle,
|
|
16
|
+
} from '@pet-adopt/ui/components/alert-dialog'
|
|
17
|
+
import { Button } from '@pet-adopt/ui/components/button'
|
|
18
|
+
import { Checkbox } from '@pet-adopt/ui/components/checkbox'
|
|
19
|
+
import { Separator } from '@pet-adopt/ui/components/separator'
|
|
20
|
+
import { Toggle } from '@pet-adopt/ui/components/toggle'
|
|
21
|
+
import { useInvalidateMedia } from '@/lib/admin/media-cache'
|
|
22
|
+
import { cn } from '@/lib/utils'
|
|
23
|
+
import { deleteManyMediaAction } from '@/server/actions/media'
|
|
24
|
+
|
|
25
|
+
// The media library grid and its toolbar. The "Select images" toggle picks the mode: off, each tile
|
|
26
|
+
// links to the image's own page (/admin/media/<id>); on, tiles are selectable (a checkbox in the
|
|
27
|
+
// top right corner, or a click on the picture; Shift selects a range) and a bulk-actions bar slides
|
|
28
|
+
// up and docks at the bottom of the screen: select the whole page, clear, and delete after a
|
|
29
|
+
// confirmation. Images still in use are skipped with their reason and stay selected. The selection
|
|
30
|
+
// covers the page on screen (`pageKey` changes on another page, size or search); the toggle stays
|
|
31
|
+
// as it is. Each tile shows the image's name under it. Results are announced in a live region;
|
|
32
|
+
// problems in an alert. Changes refresh the SWR library cache (`useInvalidateMedia`).
|
|
33
|
+
|
|
34
|
+
type Item = { id: number; thumbnailUrl: string; alt: string; name: string | null }
|
|
35
|
+
type Outcome = { text: string; problems: string[]; key: number }
|
|
36
|
+
|
|
37
|
+
export function MediaGrid({
|
|
38
|
+
items,
|
|
39
|
+
pageKey,
|
|
40
|
+
toolbarStart,
|
|
41
|
+
toolbarEnd,
|
|
42
|
+
empty,
|
|
43
|
+
busy = false,
|
|
44
|
+
}: {
|
|
45
|
+
items: Item[]
|
|
46
|
+
pageKey: string
|
|
47
|
+
/** Shown first in the toolbar row, before a divider (the page's Upload button). */
|
|
48
|
+
toolbarStart?: React.ReactNode
|
|
49
|
+
/** Shown at the end of the toolbar row (the search box). */
|
|
50
|
+
toolbarEnd?: React.ReactNode
|
|
51
|
+
/** Shown instead of the grid when there are no items. */
|
|
52
|
+
empty?: React.ReactNode
|
|
53
|
+
/** The next page or search is loading: the current one stays, dimmed. */
|
|
54
|
+
busy?: boolean
|
|
55
|
+
}) {
|
|
56
|
+
const invalidateMedia = useInvalidateMedia()
|
|
57
|
+
const viewOnly = useViewOnly()
|
|
58
|
+
const [selecting, setSelecting] = React.useState(false)
|
|
59
|
+
const [anchor, setAnchor] = React.useState<number | null>(null)
|
|
60
|
+
const [chosen, setChosen] = React.useState<Set<number>>(() => new Set())
|
|
61
|
+
// Another page of the library: start with nothing selected.
|
|
62
|
+
const [shownKey, setShownKey] = React.useState(pageKey)
|
|
63
|
+
if (shownKey !== pageKey) {
|
|
64
|
+
setShownKey(pageKey)
|
|
65
|
+
setChosen(new Set())
|
|
66
|
+
setAnchor(null)
|
|
67
|
+
}
|
|
68
|
+
const [confirming, setConfirming] = React.useState(false)
|
|
69
|
+
const [pending, startTransition] = React.useTransition()
|
|
70
|
+
const [outcome, setOutcome] = React.useState<Outcome | null>(null)
|
|
71
|
+
|
|
72
|
+
// Ids that left the page (deleted, refreshed) drop out of the selection by themselves.
|
|
73
|
+
const selected = items.filter((item) => chosen.has(item.id))
|
|
74
|
+
const count = selected.length
|
|
75
|
+
const all = count > 0 && count === items.length
|
|
76
|
+
const some = count > 0 && !all
|
|
77
|
+
|
|
78
|
+
const setSelectMode = (on: boolean) => {
|
|
79
|
+
setSelecting(on)
|
|
80
|
+
setChosen(new Set())
|
|
81
|
+
setAnchor(null)
|
|
82
|
+
setOutcome(null)
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const toggle = (index: number, checked: boolean, shiftKey: boolean) => {
|
|
86
|
+
const next = new Set(chosen)
|
|
87
|
+
// Shift-click: everything between the last clicked tile and this one follows this tile.
|
|
88
|
+
const [from, to] = shiftKey && anchor !== null ? [Math.min(anchor, index), Math.max(anchor, index)] : [index, index]
|
|
89
|
+
for (const item of items.slice(from, to + 1)) {
|
|
90
|
+
if (checked) next.add(item.id)
|
|
91
|
+
else next.delete(item.id)
|
|
92
|
+
}
|
|
93
|
+
setChosen(next)
|
|
94
|
+
setAnchor(index)
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const deleteSelected = () => {
|
|
98
|
+
setConfirming(false)
|
|
99
|
+
const ids = selected.map((item) => item.id)
|
|
100
|
+
startTransition(async () => {
|
|
101
|
+
const result = await deleteManyMediaAction(ids)
|
|
102
|
+
if (!result.ok) {
|
|
103
|
+
setOutcome({ text: '', problems: [result.error], key: Date.now() })
|
|
104
|
+
// Some images may have gone before the failure: show the library as it now is.
|
|
105
|
+
void invalidateMedia()
|
|
106
|
+
return
|
|
107
|
+
}
|
|
108
|
+
const { deleted, failed } = result.data
|
|
109
|
+
const altOf = (id: number) => {
|
|
110
|
+
const item = items.find((entry) => entry.id === id)
|
|
111
|
+
return item?.name || item?.alt || `Image ${id}`
|
|
112
|
+
}
|
|
113
|
+
setChosen(new Set(failed.map((entry) => entry.id)))
|
|
114
|
+
setOutcome({
|
|
115
|
+
text: deleted.length ? `Deleted ${deleted.length} ${deleted.length === 1 ? 'image' : 'images'}.` : '',
|
|
116
|
+
problems: failed.map((entry) => `“${altOf(entry.id)}”: ${entry.message}`),
|
|
117
|
+
key: Date.now(),
|
|
118
|
+
})
|
|
119
|
+
void invalidateMedia()
|
|
120
|
+
})
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return (
|
|
124
|
+
<div className={cn('flex flex-col gap-4', selecting && 'pb-28')}>
|
|
125
|
+
<div className="flex flex-wrap items-center gap-3">
|
|
126
|
+
{toolbarStart && !viewOnly ? (
|
|
127
|
+
<>
|
|
128
|
+
{toolbarStart}
|
|
129
|
+
{/* Decorative: it only separates the upload from the selection tools. */}
|
|
130
|
+
<Separator orientation="vertical" className="data-vertical:h-6 data-vertical:self-center" />
|
|
131
|
+
</>
|
|
132
|
+
) : null}
|
|
133
|
+
{/* The label says what pressing it does next. Base UI's Toggle also reports aria-pressed. */}
|
|
134
|
+
{/* Selecting is only for deleting: view-only roles get the plain grid of links. */}
|
|
135
|
+
{viewOnly ? null : (
|
|
136
|
+
<Toggle variant="outline" pressed={selecting} onPressedChange={(on) => setSelectMode(on)}>
|
|
137
|
+
{selecting ? <FiX aria-hidden /> : <FiCheckSquare aria-hidden />}
|
|
138
|
+
{selecting ? 'Cancel' : 'Select images'}
|
|
139
|
+
</Toggle>
|
|
140
|
+
)}
|
|
141
|
+
<p className="hidden text-sm text-muted-foreground xl:block">
|
|
142
|
+
{selecting ? 'Pick images with their checkbox or a click. Shift selects a range.' : 'Open an image to see where it is used.'}
|
|
143
|
+
</p>
|
|
144
|
+
{toolbarEnd ? <div className="ml-auto w-full sm:w-auto">{toolbarEnd}</div> : null}
|
|
145
|
+
</div>
|
|
146
|
+
|
|
147
|
+
<div aria-live="polite" className="sr-only">
|
|
148
|
+
{outcome?.text}
|
|
149
|
+
</div>
|
|
150
|
+
{outcome && (outcome.text || outcome.problems.length) ? (
|
|
151
|
+
<div key={outcome.key} className="flex flex-col gap-1 text-sm">
|
|
152
|
+
{outcome.text ? <p>{outcome.text}</p> : null}
|
|
153
|
+
{outcome.problems.length ? (
|
|
154
|
+
<div role="alert" className="text-destructive">
|
|
155
|
+
<p>
|
|
156
|
+
{outcome.problems.length === 1 ? 'One image was not deleted:' : `${outcome.problems.length} images were not deleted:`}
|
|
157
|
+
</p>
|
|
158
|
+
<ul className="list-disc pl-5">
|
|
159
|
+
{outcome.problems.map((problem) => (
|
|
160
|
+
<li key={problem}>{problem}</li>
|
|
161
|
+
))}
|
|
162
|
+
</ul>
|
|
163
|
+
</div>
|
|
164
|
+
) : null}
|
|
165
|
+
</div>
|
|
166
|
+
) : null}
|
|
167
|
+
|
|
168
|
+
{items.length === 0 ? empty : null}
|
|
169
|
+
<ul
|
|
170
|
+
className={cn('grid grid-cols-2 gap-4 transition-opacity sm:grid-cols-3 lg:grid-cols-6', busy && 'opacity-60', items.length === 0 && 'hidden')}
|
|
171
|
+
aria-busy={busy || undefined}
|
|
172
|
+
>
|
|
173
|
+
{items.map((item, index) => {
|
|
174
|
+
const isSelected = selecting && chosen.has(item.id)
|
|
175
|
+
const image = (
|
|
176
|
+
<>
|
|
177
|
+
{/* Its own frame, so the hover zoom stays clear of the caption. */}
|
|
178
|
+
<div className="overflow-hidden">
|
|
179
|
+
{/* Hover (or keyboard focus) zooms the picture a little: it reads as clickable. No
|
|
180
|
+
zoom for people who ask for reduced motion; the border and shadow stay. */}
|
|
181
|
+
{/* eslint-disable-next-line @next/next/no-img-element */}
|
|
182
|
+
<img
|
|
183
|
+
src={item.thumbnailUrl}
|
|
184
|
+
alt={item.alt}
|
|
185
|
+
className="aspect-square w-full object-cover transition-transform duration-200 ease-out group-focus-within/tile:scale-105 group-hover/tile:scale-105 motion-reduce:transition-none motion-reduce:group-focus-within/tile:scale-100 motion-reduce:group-hover/tile:scale-100"
|
|
186
|
+
/>
|
|
187
|
+
</div>
|
|
188
|
+
<p className="truncate border-t px-2 py-1.5 text-xs" title={item.name ?? undefined}>
|
|
189
|
+
{item.name ?? <span className="text-muted-foreground italic">Untitled</span>}
|
|
190
|
+
</p>
|
|
191
|
+
</>
|
|
192
|
+
)
|
|
193
|
+
return (
|
|
194
|
+
<li
|
|
195
|
+
key={item.id}
|
|
196
|
+
className={cn(
|
|
197
|
+
'group/tile relative scroll-mb-32 overflow-hidden rounded-lg border transition-[border-color,box-shadow] duration-200 hover:border-foreground/40 hover:shadow-md',
|
|
198
|
+
isSelected && 'ring-2 ring-ring ring-offset-2 ring-offset-background')}
|
|
199
|
+
>
|
|
200
|
+
{selecting ? (
|
|
201
|
+
<>
|
|
202
|
+
{/* A click on the picture toggles it too (the checkbox is the keyboard way). */}
|
|
203
|
+
<div className="cursor-pointer" onClick={(event) => toggle(index, !isSelected, event.shiftKey)}>
|
|
204
|
+
{image}
|
|
205
|
+
</div>
|
|
206
|
+
{/* Hidden until the tile is hovered or the box is checked. Opacity, not display, so
|
|
207
|
+
it stays in the tab order, and it shows on keyboard focus, while anything on the
|
|
208
|
+
page is selected, and always on touch screens (no hover there). */}
|
|
209
|
+
<span
|
|
210
|
+
className={cn(
|
|
211
|
+
'absolute top-2 right-2 flex p-1.5 opacity-0 transition-opacity group-hover/tile:opacity-100 focus-within:opacity-100 [@media(hover:none)]:opacity-100',
|
|
212
|
+
(isSelected || count > 0) && 'opacity-100',
|
|
213
|
+
)}
|
|
214
|
+
>
|
|
215
|
+
<Checkbox
|
|
216
|
+
checked={isSelected}
|
|
217
|
+
onCheckedChange={(checked, details) => toggle(index, checked, Boolean((details.event as MouseEvent | undefined)?.shiftKey))}
|
|
218
|
+
aria-label={`Select ${item.name || item.alt || `image ${item.id}`}`}
|
|
219
|
+
/>
|
|
220
|
+
</span>
|
|
221
|
+
</>
|
|
222
|
+
) : (
|
|
223
|
+
// The link's name is the picture's alt text plus the caption (its name).
|
|
224
|
+
<Link href={`/admin/media/${item.id}`} className="block rounded-lg focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring">
|
|
225
|
+
{image}
|
|
226
|
+
</Link>
|
|
227
|
+
)}
|
|
228
|
+
</li>
|
|
229
|
+
)
|
|
230
|
+
})}
|
|
231
|
+
</ul>
|
|
232
|
+
|
|
233
|
+
{/* The bulk actions dock at the bottom of the screen while selecting and slide away after.
|
|
234
|
+
When hidden it is `inert` (out of the tab order and the accessibility tree). It sits beside
|
|
235
|
+
the sidebar on wide screens, and the grid gets bottom padding and scroll margins so the
|
|
236
|
+
bar never covers a focused tile (WCAG 2.4.11). */}
|
|
237
|
+
<div
|
|
238
|
+
className={cn(
|
|
239
|
+
'pointer-events-none fixed inset-x-0 bottom-0 z-40 flex justify-center px-4 pb-[max(1rem,env(safe-area-inset-bottom))] transition-[translate,opacity] duration-300 ease-out motion-reduce:transition-none',
|
|
240
|
+
'md:group-has-[[data-slot=sidebar][data-state=expanded]]/sidebar-wrapper:left-(--sidebar-width)',
|
|
241
|
+
selecting ? 'translate-y-0 opacity-100' : 'translate-y-full opacity-0',
|
|
242
|
+
)}
|
|
243
|
+
inert={!selecting}
|
|
244
|
+
>
|
|
245
|
+
<div
|
|
246
|
+
role="group"
|
|
247
|
+
aria-label="Bulk actions"
|
|
248
|
+
className="pointer-events-auto flex w-full max-w-3xl flex-wrap items-center gap-x-4 gap-y-2 rounded-xl border bg-popover px-4 py-3 text-popover-foreground shadow-lg"
|
|
249
|
+
>
|
|
250
|
+
<label className="flex items-center gap-2 text-sm">
|
|
251
|
+
<Checkbox
|
|
252
|
+
checked={all}
|
|
253
|
+
indeterminate={some}
|
|
254
|
+
onCheckedChange={(checked) => {
|
|
255
|
+
setChosen(checked ? new Set(items.map((item) => item.id)) : new Set())
|
|
256
|
+
setAnchor(null)
|
|
257
|
+
}}
|
|
258
|
+
/>
|
|
259
|
+
Select all on this page
|
|
260
|
+
</label>
|
|
261
|
+
<p className="text-sm font-medium tabular-nums" aria-live="polite">
|
|
262
|
+
{count === 0 ? 'No images selected' : `${count} selected`}
|
|
263
|
+
</p>
|
|
264
|
+
<div className="ml-auto flex flex-wrap items-center gap-2">
|
|
265
|
+
{count > 0 ? (
|
|
266
|
+
<Button type="button" variant="ghost" size="sm" onClick={() => setChosen(new Set())}>
|
|
267
|
+
<FiX aria-hidden />
|
|
268
|
+
Clear
|
|
269
|
+
</Button>
|
|
270
|
+
) : null}
|
|
271
|
+
{/* aria-disabled, not disabled: keeps it focusable and announced while nothing is selected. */}
|
|
272
|
+
<Button
|
|
273
|
+
type="button"
|
|
274
|
+
variant="destructive"
|
|
275
|
+
size="sm"
|
|
276
|
+
aria-disabled={count === 0 || pending}
|
|
277
|
+
onClick={() => count > 0 && !pending && setConfirming(true)}
|
|
278
|
+
>
|
|
279
|
+
<FiTrash2 aria-hidden />
|
|
280
|
+
{pending ? 'Deleting…' : 'Delete selected'}
|
|
281
|
+
</Button>
|
|
282
|
+
</div>
|
|
283
|
+
</div>
|
|
284
|
+
</div>
|
|
285
|
+
|
|
286
|
+
<AlertDialog open={confirming} onOpenChange={setConfirming}>
|
|
287
|
+
<AlertDialogContent>
|
|
288
|
+
<AlertDialogHeader>
|
|
289
|
+
<AlertDialogTitle>
|
|
290
|
+
Delete {count} {count === 1 ? 'image' : 'images'}?
|
|
291
|
+
</AlertDialogTitle>
|
|
292
|
+
<AlertDialogDescription>
|
|
293
|
+
They are removed for good. Images still used by a pet, a page or the site settings are skipped, and you will see where
|
|
294
|
+
they are used.
|
|
295
|
+
</AlertDialogDescription>
|
|
296
|
+
</AlertDialogHeader>
|
|
297
|
+
<AlertDialogFooter>
|
|
298
|
+
<AlertDialogCancel>Keep them</AlertDialogCancel>
|
|
299
|
+
<Button variant="destructive" onClick={deleteSelected}>
|
|
300
|
+
Delete {count === 1 ? 'image' : 'images'}
|
|
301
|
+
</Button>
|
|
302
|
+
</AlertDialogFooter>
|
|
303
|
+
</AlertDialogContent>
|
|
304
|
+
</AlertDialog>
|
|
305
|
+
</div>
|
|
306
|
+
)
|
|
307
|
+
}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { debounce, useQueryStates } from 'nuqs'
|
|
4
|
+
import React from 'react'
|
|
5
|
+
import { FiSearch } from 'react-icons/fi'
|
|
6
|
+
|
|
7
|
+
import { mediaSearchParsers } from '@/app/(admin)/admin/media/search-params'
|
|
8
|
+
import { DemoNotice } from '@/components/admin/DemoNotice'
|
|
9
|
+
import { useDemo } from '@/components/admin/demo-mode'
|
|
10
|
+
import { EmptyState } from '@/components/admin/EmptyState'
|
|
11
|
+
import { MediaGrid } from '@/components/admin/MediaGrid'
|
|
12
|
+
import { MediaPager } from '@/components/admin/MediaPager'
|
|
13
|
+
import { UploadPhotosDialog } from '@/components/admin/UploadPhotosDialog'
|
|
14
|
+
import { Button } from '@pet-adopt/ui/components/button'
|
|
15
|
+
import { InputGroup, InputGroupButton, InputGroupInput } from '@pet-adopt/ui/components/input-group'
|
|
16
|
+
import { Skeleton } from '@pet-adopt/ui/components/skeleton'
|
|
17
|
+
import { useMediaList, type MediaListSeed } from '@/lib/admin/use-media-list'
|
|
18
|
+
|
|
19
|
+
// The media library screen, built like the pets list: the view lives in the URL (?search=&page=
|
|
20
|
+
// &perPage=) through nuqs, written shallowly (the server is not asked), and the images are fetched
|
|
21
|
+
// and cached with SWR (`useMediaList`). The server page only seeds the first render. The search box
|
|
22
|
+
// matches the image's name and its description; typing updates the URL after a short pause, Enter
|
|
23
|
+
// at once, and a new search goes back to page 1. In the demo uploads are turned off: a note above the
|
|
24
|
+
// grid replaces the Upload button (the library comes with the sample pictures).
|
|
25
|
+
|
|
26
|
+
const SEARCH_DEBOUNCE_MS = 300
|
|
27
|
+
|
|
28
|
+
export function MediaLibrary({ initialFilters, initialData }: MediaListSeed) {
|
|
29
|
+
const { filters, data, error, isLoading, mutate } = useMediaList({ initialFilters, initialData })
|
|
30
|
+
const [query, setQuery] = useQueryStates(mediaSearchParsers)
|
|
31
|
+
const demo = useDemo()
|
|
32
|
+
|
|
33
|
+
// A page past the end (the last images on it were deleted, or an old link): step back.
|
|
34
|
+
const lastPage = data && data.totalDocs > 0 && data.page > data.totalPages ? data.totalPages : null
|
|
35
|
+
React.useEffect(() => {
|
|
36
|
+
if (lastPage) void setQuery({ page: lastPage })
|
|
37
|
+
}, [lastPage, setQuery])
|
|
38
|
+
|
|
39
|
+
const search = (
|
|
40
|
+
<form
|
|
41
|
+
role="search"
|
|
42
|
+
onSubmit={(event) => {
|
|
43
|
+
// Enter or the button: skip the wait.
|
|
44
|
+
event.preventDefault()
|
|
45
|
+
void setQuery({ search: query.search, page: 1 })
|
|
46
|
+
}}
|
|
47
|
+
>
|
|
48
|
+
<InputGroup className="sm:w-72">
|
|
49
|
+
<InputGroupInput
|
|
50
|
+
type="search"
|
|
51
|
+
name="search"
|
|
52
|
+
aria-label="Search images by name or description"
|
|
53
|
+
placeholder="Search by name or description"
|
|
54
|
+
value={query.search}
|
|
55
|
+
onChange={(event) => void setQuery({ search: event.target.value, page: 1 }, { limitUrlUpdates: debounce(SEARCH_DEBOUNCE_MS) })}
|
|
56
|
+
/>
|
|
57
|
+
<InputGroupButton type="submit" aria-label="Search">
|
|
58
|
+
<FiSearch aria-hidden />
|
|
59
|
+
</InputGroupButton>
|
|
60
|
+
</InputGroup>
|
|
61
|
+
</form>
|
|
62
|
+
)
|
|
63
|
+
|
|
64
|
+
if (!data) {
|
|
65
|
+
return error ? (
|
|
66
|
+
<div role="alert" className="flex flex-col items-start gap-3 text-sm">
|
|
67
|
+
<p className="text-destructive">The images could not be loaded: {error.message}</p>
|
|
68
|
+
<Button type="button" variant="outline" onClick={() => void mutate()}>
|
|
69
|
+
Try again
|
|
70
|
+
</Button>
|
|
71
|
+
</div>
|
|
72
|
+
) : (
|
|
73
|
+
<div className="grid grid-cols-2 gap-4 sm:grid-cols-3 lg:grid-cols-6" aria-busy="true" aria-label="Loading images">
|
|
74
|
+
{Array.from({ length: Math.min(filters.perPage, 12) }, (_, index) => (
|
|
75
|
+
<Skeleton key={index} className="aspect-square w-full rounded-lg" />
|
|
76
|
+
))}
|
|
77
|
+
</div>
|
|
78
|
+
)
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
const searching = filters.search.trim() !== ''
|
|
82
|
+
return (
|
|
83
|
+
<>
|
|
84
|
+
{demo ? <DemoNotice className="mb-4" what="Uploading images" why="the library comes with the sample pictures" /> : null}
|
|
85
|
+
<MediaGrid
|
|
86
|
+
items={data.docs.map((item) => ({ id: item.id, thumbnailUrl: item.thumbnailUrl, alt: item.alt, name: item.name }))}
|
|
87
|
+
pageKey={`${filters.page}-${filters.perPage}-${filters.search}`}
|
|
88
|
+
// Dim only while a new search or page loads (the previous one stays shown), not on background refetches.
|
|
89
|
+
busy={isLoading && data.docs.length > 0}
|
|
90
|
+
toolbarStart={demo ? undefined : <UploadPhotosDialog />}
|
|
91
|
+
toolbarEnd={search}
|
|
92
|
+
empty={
|
|
93
|
+
searching ? (
|
|
94
|
+
<EmptyState title="No images match">Nothing is named or described “{filters.search.trim()}”. Try another word.</EmptyState>
|
|
95
|
+
) : (
|
|
96
|
+
<EmptyState title="No images yet">{demo ? 'The sample pictures come back when the demo resets.' : 'Upload a photo to get started.'}</EmptyState>
|
|
97
|
+
)
|
|
98
|
+
}
|
|
99
|
+
/>
|
|
100
|
+
{data.totalDocs > 0 ? <MediaPager page={data.page} perPage={filters.perPage} totalDocs={data.totalDocs} totalPages={data.totalPages} /> : null}
|
|
101
|
+
</>
|
|
102
|
+
)
|
|
103
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import { usePathname } from 'next/navigation'
|
|
4
|
+
import { createSerializer, useQueryStates } from 'nuqs'
|
|
5
|
+
import React from 'react'
|
|
6
|
+
|
|
7
|
+
import { mediaSearchParsers } from '@/app/(admin)/admin/media/search-params'
|
|
8
|
+
import { PetPagination } from '@/components/admin/pets/PetPagination'
|
|
9
|
+
import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@pet-adopt/ui/components/select'
|
|
10
|
+
import { MEDIA_PAGE_SIZES } from '@/lib/admin/media-page'
|
|
11
|
+
|
|
12
|
+
// The media library's footer: "Showing 25–48 of 130", how many per page, and the pager. Both write
|
|
13
|
+
// the URL through nuqs (?page=, ?perPage=, shallow: the server is not asked), and the library
|
|
14
|
+
// reads it and fetches with SWR, like the pets list. The pager's links are real hrefs (they can
|
|
15
|
+
// be opened in a new tab). Changing the size keeps the first image you were looking at on screen.
|
|
16
|
+
|
|
17
|
+
const serialize = createSerializer(mediaSearchParsers)
|
|
18
|
+
|
|
19
|
+
export function MediaPager({ page, perPage, totalDocs, totalPages }: { page: number; perPage: number; totalDocs: number; totalPages: number }) {
|
|
20
|
+
const pathname = usePathname()
|
|
21
|
+
const [filters, setFilters] = useQueryStates(mediaSearchParsers)
|
|
22
|
+
|
|
23
|
+
const first = totalDocs === 0 ? 0 : (page - 1) * perPage + 1
|
|
24
|
+
const last = Math.min(page * perPage, totalDocs)
|
|
25
|
+
|
|
26
|
+
return (
|
|
27
|
+
<div className="mt-6 flex flex-wrap items-center justify-between gap-4">
|
|
28
|
+
<div className="flex flex-wrap items-center gap-4 text-sm text-muted-foreground">
|
|
29
|
+
<p aria-live="polite">{totalDocs === 0 ? 'No images' : `Showing ${first}–${last} of ${totalDocs}`}</p>
|
|
30
|
+
<div className="flex items-center gap-2">
|
|
31
|
+
<label htmlFor="media-per-page">Per page</label>
|
|
32
|
+
<Select
|
|
33
|
+
items={MEDIA_PAGE_SIZES.options.map((size) => ({ value: String(size), label: String(size) }))}
|
|
34
|
+
value={String(perPage)}
|
|
35
|
+
onValueChange={(value) => {
|
|
36
|
+
const size = Number(value) as (typeof MEDIA_PAGE_SIZES.options)[number]
|
|
37
|
+
if (!size || size === perPage) return
|
|
38
|
+
// Stay on the page that holds the first image shown now.
|
|
39
|
+
setFilters({ perPage: size, page: Math.floor(((page - 1) * perPage) / size) + 1 })
|
|
40
|
+
}}
|
|
41
|
+
>
|
|
42
|
+
<SelectTrigger id="media-per-page" size="sm" className="w-20 text-foreground">
|
|
43
|
+
<SelectValue />
|
|
44
|
+
</SelectTrigger>
|
|
45
|
+
<SelectContent>
|
|
46
|
+
{MEDIA_PAGE_SIZES.options.map((size) => (
|
|
47
|
+
<SelectItem key={size} value={String(size)}>
|
|
48
|
+
{size}
|
|
49
|
+
</SelectItem>
|
|
50
|
+
))}
|
|
51
|
+
</SelectContent>
|
|
52
|
+
</Select>
|
|
53
|
+
</div>
|
|
54
|
+
</div>
|
|
55
|
+
<PetPagination
|
|
56
|
+
page={page}
|
|
57
|
+
totalPages={totalPages}
|
|
58
|
+
hrefFor={(target) => pathname + serialize({ ...filters, page: target })}
|
|
59
|
+
onPageChange={(target) => {
|
|
60
|
+
setFilters({ page: target })
|
|
61
|
+
window.scrollTo({ top: 0 })
|
|
62
|
+
}}
|
|
63
|
+
/>
|
|
64
|
+
</div>
|
|
65
|
+
)
|
|
66
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react'
|
|
2
|
+
|
|
3
|
+
// One <h1> per screen, with an optional description and a slot for the main action (e.g. "Add pet").
|
|
4
|
+
export function PageHeader({
|
|
5
|
+
title,
|
|
6
|
+
description,
|
|
7
|
+
actions,
|
|
8
|
+
}: {
|
|
9
|
+
title: string
|
|
10
|
+
description?: string
|
|
11
|
+
actions?: React.ReactNode
|
|
12
|
+
}) {
|
|
13
|
+
return (
|
|
14
|
+
<div className="mb-6 flex flex-wrap items-start justify-between gap-3">
|
|
15
|
+
<div>
|
|
16
|
+
<h1 className="text-2xl font-semibold">{title}</h1>
|
|
17
|
+
{description ? <p className="mt-1 text-sm text-muted-foreground">{description}</p> : null}
|
|
18
|
+
</div>
|
|
19
|
+
{actions ? <div className="flex gap-2">{actions}</div> : null}
|
|
20
|
+
</div>
|
|
21
|
+
)
|
|
22
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
import { Button } from '@pet-adopt/ui/components/button'
|
|
6
|
+
import { Combobox, ComboboxContent, ComboboxEmpty, ComboboxInput, ComboboxItem, ComboboxList, ComboboxTrigger } from '@pet-adopt/ui/components/combobox'
|
|
7
|
+
import { Input } from '@pet-adopt/ui/components/input'
|
|
8
|
+
import { countryOf, DEFAULT_REGION, formatNational, joinPhone, listCountries, splitPhone, type Country } from '@/lib/phone'
|
|
9
|
+
|
|
10
|
+
// A phone number as a country picker (searchable by name, ISO code or "+60") plus the number.
|
|
11
|
+
// The value is one string in E.164 ("+60123456789"), or as typed while it is not a valid number,
|
|
12
|
+
// so validation (libphonenumber-js, src/lib/phone.ts) can say what is wrong. The field's <label>
|
|
13
|
+
// points at the number box; the picker names itself and the country it holds.
|
|
14
|
+
|
|
15
|
+
const countries = listCountries()
|
|
16
|
+
|
|
17
|
+
/** Search: the name anywhere, the ISO code exactly, or the calling code from its start ("+6", "60"). */
|
|
18
|
+
function matches(country: Country, query: string) {
|
|
19
|
+
const q = query.trim().toLowerCase()
|
|
20
|
+
if (!q) return true
|
|
21
|
+
const digits = q.replace(/^\+/, '')
|
|
22
|
+
if (/^\d+$/.test(digits)) return String(country.callingCode).startsWith(digits)
|
|
23
|
+
return country.name.toLowerCase().includes(q) || country.region.toLowerCase() === q
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export function PhoneInput({
|
|
27
|
+
id,
|
|
28
|
+
value,
|
|
29
|
+
onChange,
|
|
30
|
+
onBlur,
|
|
31
|
+
inputRef,
|
|
32
|
+
invalid,
|
|
33
|
+
describedBy,
|
|
34
|
+
required,
|
|
35
|
+
autoComplete = 'tel',
|
|
36
|
+
}: {
|
|
37
|
+
id: string
|
|
38
|
+
value: string
|
|
39
|
+
onChange: (value: string) => void
|
|
40
|
+
onBlur?: () => void
|
|
41
|
+
/** A callback ref, such as React Hook Form's `field.ref` (so a failed save can focus the number). */
|
|
42
|
+
inputRef?: (node: HTMLInputElement | null) => void
|
|
43
|
+
invalid?: boolean
|
|
44
|
+
describedBy?: string
|
|
45
|
+
required?: boolean
|
|
46
|
+
autoComplete?: string
|
|
47
|
+
}) {
|
|
48
|
+
const [state, setState] = React.useState(() => splitPhone(value))
|
|
49
|
+
// The last value this input sent. Anything else arriving (a form reset, a reload) is re-split.
|
|
50
|
+
const [sent, setSent] = React.useState(value)
|
|
51
|
+
if (value !== sent) {
|
|
52
|
+
setSent(value)
|
|
53
|
+
setState(splitPhone(value, state.region))
|
|
54
|
+
}
|
|
55
|
+
const numberRef = React.useRef<HTMLInputElement | null>(null)
|
|
56
|
+
const country = countryOf(state.region) ?? countryOf(DEFAULT_REGION)!
|
|
57
|
+
|
|
58
|
+
const send = (next: { region: string; national: string }) => {
|
|
59
|
+
setState(next)
|
|
60
|
+
const joined = joinPhone(next.region, next.national)
|
|
61
|
+
setSent(joined)
|
|
62
|
+
onChange(joined)
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<div className="flex gap-2">
|
|
67
|
+
<Combobox
|
|
68
|
+
items={countries}
|
|
69
|
+
value={country}
|
|
70
|
+
onValueChange={(picked: Country | null) => {
|
|
71
|
+
if (!picked) return
|
|
72
|
+
send({ region: picked.region, national: state.national })
|
|
73
|
+
requestAnimationFrame(() => numberRef.current?.focus())
|
|
74
|
+
}}
|
|
75
|
+
itemToStringLabel={(item: Country) => `${item.name} +${item.callingCode}`}
|
|
76
|
+
itemToStringValue={(item: Country) => item.region}
|
|
77
|
+
isItemEqualToValue={(a: Country, b: Country) => a.region === b.region}
|
|
78
|
+
filter={(item: Country, query: string) => matches(item, query)}
|
|
79
|
+
>
|
|
80
|
+
<ComboboxTrigger
|
|
81
|
+
render={<Button type="button" variant="outline" className="shrink-0 gap-1.5 px-2.5 font-normal tabular-nums" />}
|
|
82
|
+
aria-label={`Country code: ${country.name}, +${country.callingCode}`}
|
|
83
|
+
aria-invalid={invalid || undefined}
|
|
84
|
+
>
|
|
85
|
+
<span aria-hidden="true">{country.flag}</span>+{country.callingCode}
|
|
86
|
+
</ComboboxTrigger>
|
|
87
|
+
<ComboboxContent className="w-72 min-w-0">
|
|
88
|
+
<ComboboxInput showTrigger={false} placeholder="Search country or code" aria-label="Search countries or codes" />
|
|
89
|
+
<ComboboxEmpty>No country matches.</ComboboxEmpty>
|
|
90
|
+
<ComboboxList>
|
|
91
|
+
{(item: Country) => (
|
|
92
|
+
<ComboboxItem key={item.region} value={item}>
|
|
93
|
+
<span aria-hidden="true">{item.flag}</span>
|
|
94
|
+
<span className="min-w-0 flex-1 truncate">{item.name}</span>
|
|
95
|
+
<span className="text-muted-foreground tabular-nums">+{item.callingCode}</span>
|
|
96
|
+
</ComboboxItem>
|
|
97
|
+
)}
|
|
98
|
+
</ComboboxList>
|
|
99
|
+
</ComboboxContent>
|
|
100
|
+
</Combobox>
|
|
101
|
+
<Input
|
|
102
|
+
id={id}
|
|
103
|
+
ref={(node) => {
|
|
104
|
+
numberRef.current = node
|
|
105
|
+
inputRef?.(node)
|
|
106
|
+
}}
|
|
107
|
+
type="tel"
|
|
108
|
+
inputMode="tel"
|
|
109
|
+
autoComplete={autoComplete}
|
|
110
|
+
value={state.national}
|
|
111
|
+
placeholder={country.region === 'MY' ? '12 345 6789' : undefined}
|
|
112
|
+
onChange={(event) => send({ region: state.region, national: event.target.value })}
|
|
113
|
+
onBlur={() => {
|
|
114
|
+
// A number pasted with its own "+code" moves the picker to that country; a valid number
|
|
115
|
+
// is tidied into the usual grouping ("123456789" -> "12 345 6789").
|
|
116
|
+
const typed = state.national.trim()
|
|
117
|
+
const next = typed.startsWith('+') ? splitPhone(typed, state.region) : { region: state.region, national: formatNational(state.region, typed) }
|
|
118
|
+
if (next.region !== state.region || next.national !== state.national) send(next)
|
|
119
|
+
onBlur?.()
|
|
120
|
+
}}
|
|
121
|
+
aria-invalid={invalid || undefined}
|
|
122
|
+
aria-required={required || undefined}
|
|
123
|
+
aria-describedby={describedBy}
|
|
124
|
+
className="min-w-0 flex-1"
|
|
125
|
+
/>
|
|
126
|
+
</div>
|
|
127
|
+
)
|
|
128
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import React from 'react'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Keeps one plugin dashboard card's failure inside that card (see PluginWidgets). A widget that
|
|
7
|
+
* throws while rendering on the server reaches the browser as an error in its place in the tree,
|
|
8
|
+
* which this boundary catches; Next has already logged it on the server with the same `digest`.
|
|
9
|
+
* Without it, admin/error.tsx would replace the whole dashboard.
|
|
10
|
+
*/
|
|
11
|
+
export class PluginWidgetBoundary extends React.Component<
|
|
12
|
+
{ children: React.ReactNode },
|
|
13
|
+
{ error: unknown; digest: string | null }
|
|
14
|
+
> {
|
|
15
|
+
state = { error: null as unknown, digest: null as string | null }
|
|
16
|
+
|
|
17
|
+
static getDerivedStateFromError(error: unknown) {
|
|
18
|
+
const digest = typeof error === 'object' && error !== null && 'digest' in error ? String((error as { digest: unknown }).digest) : null
|
|
19
|
+
return { error: error ?? new Error('Unknown error'), digest }
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
render() {
|
|
23
|
+
if (this.state.error === null) return this.props.children
|
|
24
|
+
// redirect() and notFound() travel as errors with a NEXT_ digest: leave them to Next.
|
|
25
|
+
if (this.state.digest?.startsWith('NEXT_')) throw this.state.error
|
|
26
|
+
return (
|
|
27
|
+
<p className="text-sm text-muted-foreground">
|
|
28
|
+
This card could not be loaded. Reload the page to try again.
|
|
29
|
+
{this.state.digest ? (
|
|
30
|
+
<>
|
|
31
|
+
{' '}
|
|
32
|
+
Reference: <code className="font-mono">{this.state.digest}</code>
|
|
33
|
+
</>
|
|
34
|
+
) : null}
|
|
35
|
+
</p>
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
}
|