up source block

This commit is contained in:
tykayn 2025-08-18 17:41:16 +02:00
parent d84071ed49
commit c3319a6e84
4 changed files with 41 additions and 5 deletions

View file

@ -1,15 +1,15 @@
<div class="source">
<div [ngClass]="{'expanded': expanded}" class="source">
<i class="ri-file-3-line"></i>
<span class="title">{{ source.title || 'Source sans nom' }}</span>
<a class="title">{{ source.title || 'Source sans nom' }}</a>
<div class="actions has-text-right">
<i class="ri-file-add-line"></i>
<i class="ri-arrow-down-s-line"></i>
<i (click)="toggleExpanded()" class="ri-arrow-down-s-line"></i>
</div>
<div class="description">
<div (click)="toggleExpanded()" class="description">
{{ source.description || description }}
</div>

View file

@ -1,3 +1,7 @@
//@use "remixicon/fonts/remixicon.scss";
//@use "sae-lib/src/styles/variables";
.source {
padding: 10px;
margin-bottom: 10px;
@ -9,16 +13,34 @@
cursor: pointer;
border-radius: 4px;
height: 100px;
overflow: hidden;
text-overflow: ellipsis;
&.expanded {
height: auto;
}
.title {
color: #1E1F22;
font-size: 14px;
font-weight: 600;
margin-left: 3px;
cursor: pointer;
&:hover {
color: #005AA2;
text-decoration: underline;
}
}
.actions {
color: #005AA2;
float: right;
i {
margin-left: 10px;
}
}
&:hover {

View file

@ -1,11 +1,19 @@
import type { Meta, StoryObj } from '@storybook/angular';
import { SourceBlock } from './source-block';
import { ChatbotSource } from '../../services/conversations.service';
import { moduleMetadata } from '@storybook/angular';
import { CommonModule } from '@angular/common';
const meta: Meta<SourceBlock> = {
title: 'Components/SourceBlock',
component: SourceBlock,
tags: ['autodocs'],
decorators: [
moduleMetadata({
imports: [CommonModule],
providers: []
})
],
argTypes: {
source: {
control: 'object',

View file

@ -1,14 +1,20 @@
import {Component, Input} from '@angular/core';
import {ChatbotSource} from '../../services/conversations.service';
import {CommonModule} from '@angular/common';
@Component({
selector: 'app-source-block',
imports: [],
imports: [CommonModule],
templateUrl: './source-block.html',
styleUrl: './source-block.scss'
})
export class SourceBlock {
public expanded: boolean = false;
@Input() source: ChatbotSource = {} as ChatbotSource;
description: string = "lorem blah blah";
toggleExpanded() {
this.expanded = !this.expanded
}
}