import './Stone.css'
import React from 'react'

export function Stone({ color }) {
    switch (color) {
        case WHITE():
            return WhiteStone()

        case BLACK():
            return BlackStone()

        default:
            console.warn("Unknown color: ", color)
    }
}

export function WhiteStone() {
    return <span className="stone white">⛀</span>
}

export function BlackStone() {
    return <span className="stone black">⛂</span>
}

export function oppositeColor(color) {
    if (color === WHITE())
        return BLACK()

    if (color === BLACK())
        return WHITE()

    return color
}

export function WHITE() {
    return "WHITE"
}

export function BLACK() {
    return "BLACK"
}
