import { LitElement } from "lit"; import { html } from "lit"; import { customElement, state } from "lit/decorators.js"; import { dp } from "@supersoniks/concorde/directives"; import "./states"; import { tailwind } from "../../../../docs/tailwind"; @customElement("sonic-states-demo") export class SonicStatesDemo extends LitElement { static styles = [tailwind]; constructor() { super(); // Initialisation du dataProvider dp("states-demo-provider").set({}); } @state() private states = { pending: () => html`

En attente

Veuillez patienter...

`, "user/:id/:status": ({ id, status, }: { id: string; status: string; }) => html`

Utilisateur ${id}

Statut: ${status}

`, "error_(\\d+)": ([code]: [string]) => html`

Erreur ${code}

Une erreur s'est produite

`, fallback: () => html`

État Inconnu

L'état demandé n'existe pas

`, }; render() { return html`

Démo des états

En attente Utilisateur Actif Erreur 404 État Invalide
`; } }