import { cn } from "#lib/utils.ts";
import { previous as styles } from "./classes.ts";
import PaginationLink from "./link.marko";

export interface Input extends Marko.Input<"a"> {
  text?: string;
}

<const/{ class: className, text = "Previous", ...rest }=input/>

<PaginationLink
  aria-label="Go to previous page"
  size="default"
  class=cn(styles.root, className)
  ...rest
>
  <svg
    xmlns="http://www.w3.org/2000/svg"
    width="24"
    height="24"
    viewBox="0 0 24 24"
    fill="none"
    stroke="currentColor"
    stroke-width="2"
    stroke-linecap="round"
    stroke-linejoin="round"
    data-icon="inline-start"
    class=styles.icon
  >
    <path d="m15 18-6-6 6-6"/>
  </svg>
  <span class=styles.text>${text}</span>
</PaginationLink>
