aboutsummaryrefslogtreecommitdiffstats
path: root/src/components/service.tsx
blob: b350d3ad92b0230220a79d6b51f17149c837034b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import * as React from 'react';
import styled from 'styled-components';
import { capitalize } from '../utils';

export type ServiceProps = {
    slug: string;
    name: string;
    description: string;
    url: string;
    tags: string[];
    image: string;
}

const ServiceCard = styled.a`
    background-color: #fff;
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    color: #000;
    text-decoration: none;
    transition: filter 0.2s, transform 0.2s;
    box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);

    &:hover {
        filter: brightness(0.9);
        transform: translateY(-5px);
    }
`;

export const Tag = styled.span`
    background-color: rgba(110, 119, 255, 0.39);
    color: #000;
    font-weight: 600;
    font-family: monospace;
    border-radius: 5px;
    padding: 5px;
    margin: 5px;
    display: inline-block;
`;

const ServiceImage = styled.img`
    border-radius: 10px;
    width: 80px;
`;

const ServiceHeader = styled.h3`
    margin: 0;
`;

const ServiceDescription = styled.p`
    margin: 0;
`;


const Service: React.FC<ServiceProps> = ({ name, description, url, tags, image }) => {
    return (
        <ServiceCard href={url}>
            <ServiceImage src={image} alt={name} />
            <ServiceHeader>{name}</ServiceHeader>
            <ServiceDescription>{description}</ServiceDescription>
            <div>
                {
                    tags.map((tag, index) => (
                        <Tag key={index}>{capitalize(tag)}</Tag>
                    ))
                }
            </div>
        </ServiceCard>
    );
}

export default Service;