defmodule ChiyaWeb.CoreComponents do @moduledoc """ Provides core UI components. The components in this module use Tailwind CSS, a utility-first CSS framework. See the [Tailwind CSS documentation](https://tailwindcss.com) to learn how to customize the generated components in this module. Icons are provided by [heroicons](https://heroicons.com). See `icon/1` for usage. """ use Phoenix.Component use Phoenix.VerifiedRoutes, endpoint: ChiyaWeb.Endpoint, router: ChiyaWeb.Router, statics: ChiyaWeb.static_paths() alias Phoenix.LiveView.JS import ChiyaWeb.Gettext import ChiyaWeb.DarkModeToggle import Flop.Phoenix def favicon(assigns) do ~H""" """ end @doc """ Renders a modal. ## Examples <.modal id="confirm-modal"> Are you sure? <:confirm>OK <:cancel>Cancel JS commands may be passed to the `:on_cancel` and `on_confirm` attributes for the caller to react to each button press, for example: <.modal id="confirm" on_confirm={JS.push("delete")} on_cancel={JS.navigate(~p"/posts")}> Are you sure you? <:confirm>OK <:cancel>Cancel """ attr :id, :string, required: true attr :show, :boolean, default: false attr :on_cancel, JS, default: %JS{} attr :on_confirm, JS, default: %JS{} slot :inner_block, required: true slot :title slot :subtitle slot :confirm slot :cancel def modal(assigns) do ~H"""