---
import type { Testimonial } from '@/types/sections/testimonials-section.types';
import LinkButton from '@/web/components/link-button.astro';
import Typography from '@/web/components/typography.astro';
import Description from '@/web/components/description.astro';
import Thumbnail from '@/web/components/thumbnail.astro';

export interface Props extends Testimonial {}

const { author, content, image, links, relation } = Astro.props;
---

<div class="flex w-full flex-col gap-4">
  <div class="flex justify-between">
    <div class="flex flex-col gap-4 sm:flex-row">
      <Thumbnail src={image} alt={author} size="small" />
      <div>
        <Typography variant="item-title">{author}</Typography>
        <Typography variant="item-subtitle-secondary">{relation}</Typography>
      </div>
    </div>
    {
      links.length > 0 && (
        <div class="flex gap-3">
          {links.map((link) => (
            <LinkButton {...link} />
          ))}
        </div>
      )
    }
  </div>
  <Description content={content} />
</div>
